宠物店修改

This commit is contained in:
kai60 2020-05-02 14:56:49 +08:00
parent 8fca79324a
commit 53f06fcf43
100 changed files with 2672 additions and 198 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -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 = "<group>"; };
C024B79C2379668B00509424 /* NSMutableAttributedString+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableAttributedString+AvoidCrash.h"; sourceTree = "<group>"; };
C024B79D2379668B00509424 /* NSMutableArray+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableArray+AvoidCrash.h"; sourceTree = "<group>"; };
C0837A55244FF5500034FEC5 /* EGOCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EGOCache.m; sourceTree = "<group>"; };
C0837A56244FF5500034FEC5 /* EGOCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EGOCache.h; sourceTree = "<group>"; };
C0B2F53E244C6FE3001079AA /* PetStoresViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PetStoresViewController.h; sourceTree = "<group>"; };
C0B2F53F244C6FE3001079AA /* PetStoresViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PetStoresViewController.m; sourceTree = "<group>"; };
C0B2F540244C6FE3001079AA /* PetStoresViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PetStoresViewController.xib; sourceTree = "<group>"; };
C0B2F55B244D5577001079AA /* StoreNameView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StoreNameView.h; sourceTree = "<group>"; };
C0B2F55C244D5577001079AA /* StoreNameView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = StoreNameView.m; sourceTree = "<group>"; };
C0B2F55F244D568E001079AA /* StoreNameView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = StoreNameView.xib; sourceTree = "<group>"; };
C0E746D4239E4A7C001BCD6D /* wechatlogin.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = wechatlogin.png; sourceTree = "<group>"; };
C0E7D6BC23A1D11200256A10 /* WXApiRequestHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXApiRequestHandler.h; sourceTree = "<group>"; };
C0E7D6BD23A1D11200256A10 /* WXApiManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXApiManager.h; sourceTree = "<group>"; };
@ -5745,6 +5763,8 @@
C0EA8A0F23AF74F3003DC53B /* UIButton+WebCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIButton+WebCache.m"; sourceTree = "<group>"; };
C0EA8A1023AF74F3003DC53B /* UIImage+GIF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+GIF.h"; sourceTree = "<group>"; };
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 = "<group>"; };
C0F6E1BF243B0A840071ECB9 /* xuanduo3fModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = xuanduo3fModel.m; sourceTree = "<group>"; };
CB0F4E7B22951A130091C76D /* SVRadialGradientLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVRadialGradientLayer.m; sourceTree = "<group>"; };
CB0F4E7C22951A130091C76D /* SVIndefiniteAnimatedView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVIndefiniteAnimatedView.h; sourceTree = "<group>"; };
CB0F4E7D22951A130091C76D /* SVProgressHUD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVProgressHUD.h; sourceTree = "<group>"; };
@ -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 = "<group>";
};
C0837A54244FF5500034FEC5 /* EGOCache */ = {
isa = PBXGroup;
children = (
C0837A55244FF5500034FEC5 /* EGOCache.m */,
C0837A56244FF5500034FEC5 /* EGOCache.h */,
);
path = EGOCache;
sourceTree = "<group>";
};
C0B2F53D244C6FAF001079AA /* pets */ = {
isa = PBXGroup;
children = (
C0B2F53E244C6FE3001079AA /* PetStoresViewController.h */,
C0B2F53F244C6FE3001079AA /* PetStoresViewController.m */,
C0B2F540244C6FE3001079AA /* PetStoresViewController.xib */,
);
path = pets;
sourceTree = "<group>";
};
C0B2F55A244D552A001079AA /* petsStoreName */ = {
isa = PBXGroup;
children = (
C0B2F55B244D5577001079AA /* StoreNameView.h */,
C0B2F55C244D5577001079AA /* StoreNameView.m */,
C0B2F55F244D568E001079AA /* StoreNameView.xib */,
);
name = petsStoreName;
sourceTree = "<group>";
};
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";

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 KiB

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 KiB

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 KiB

After

Width:  |  Height:  |  Size: 218 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "智能宠物系统.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 157 KiB

After

Width:  |  Height:  |  Size: 144 KiB

View File

@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -0,0 +1,12 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
},
"data" : [
{
"idiom" : "universal",
"filename" : "firstlogo"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@ -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"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

@ -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"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 KiB

View File

@ -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"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@ -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"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 679 B

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "恒温关.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "恒温开.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "换气关.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "换气开.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "杀菌关.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "杀菌开.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "照明关.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "照明开.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -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"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

View File

@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>5.1.4</string>
<string>5.1.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
@ -70,7 +70,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>19</string>
<string>3</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationCategoryType</key>

View File

@ -7,7 +7,7 @@
//
#import <Foundation/Foundation.h>
#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

View File

@ -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

View File

@ -57,5 +57,6 @@
//新绚多
+(void)saveNewXuToControlName:(XuToControlName *)nameModel;
+(XuToControlName *)currentNewXuToControlName:(NSString *)macaddress;
+(XuToControlName *)currentPetsXuToControlName:(NSString *)macaddress;
@end

View File

@ -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;
}

View File

@ -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 <Foundation/Foundation.h>
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#endif
#if TARGET_OS_OSX
#import <AppKit/AppKit.h>
#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<NSCoding>)objectForKey:(NSString* __nonnull)key;
- (void)setObject:(nonnull id<NSCoding>)anObject forKey:(NSString* __nonnull)key;
- (void)setObject:(nonnull id<NSCoding>)anObject forKey:(NSString* __nonnull)key withTimeoutInterval:(NSTimeInterval)timeoutInterval;
@property(nonatomic) NSTimeInterval defaultTimeoutInterval; // Default is 1 day
@end

View File

@ -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<NSCoding>)objectForKey:(NSString*)key {
if([self hasCacheForKey:key]) {
return [NSKeyedUnarchiver unarchiveObjectWithData:[self dataForKey:key]];
} else {
return nil;
}
}
- (void)setObject:(id<NSCoding>)anObject forKey:(NSString*)key {
[self setObject:anObject forKey:key withTimeoutInterval:self.defaultTimeoutInterval];
}
- (void)setObject:(id<NSCoding>)anObject forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval {
[self setData:[NSKeyedArchiver archivedDataWithRootObject:anObject] forKey:key withTimeoutInterval:timeoutInterval];
}
@end

View File

@ -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];

View File

@ -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];

View File

@ -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"];

View File

@ -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

View File

@ -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];

View File

@ -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];
}

View File

@ -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;

View File

@ -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

View File

@ -14,6 +14,7 @@
#import "ESPTouchResult.h"
#import "ESPTouchTask.h"
#import "IfishDataUnity.h"
#import "MyMD5.h"
#import <GWP2P/GWP2P.h>
@interface ConnectingAquarVC ()<IFishHotpotUDPHelperDelegate>
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;

View File

@ -10,5 +10,6 @@
@interface RuSunChangeNameTitleViewCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UITextField *deviceName;
@property (weak, nonatomic) IBOutlet UILabel *cNTitle;
@end

View File

@ -1,12 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@ -27,7 +26,7 @@
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="水族箱" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Dae-FO-MMJ">
<rect key="frame" x="58" y="14" width="54" height="21"/>
<rect key="frame" x="58" y="14.5" width="54" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="avD-IG-wRe"/>
<constraint firstAttribute="width" constant="54" id="ex7-wD-xWL"/>
@ -37,7 +36,7 @@
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="我的水族箱" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="cgK-Ks-2s1">
<rect key="frame" x="173" y="0.0" width="122" height="50"/>
<rect key="frame" x="173" y="-0.5" width="122" height="50.5"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="2zD-xY-XTZ"/>
</constraints>
@ -57,6 +56,7 @@
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="cNTitle" destination="Dae-FO-MMJ" id="U2e-nu-70l"/>
<outlet property="deviceName" destination="cgK-Ks-2s1" id="n3G-VN-O4U"/>
</connections>
</tableViewCell>

View File

@ -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];
}
}

View File

@ -8,7 +8,7 @@
#import <Foundation/Foundation.h>
@interface XuToControlName : NSObject
@interface XuToControlName : NSObject<NSCoding>
@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;

View File

@ -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;

View File

@ -7,9 +7,12 @@
//
#import "IfishDeviceControlNameBaseController.h"
#import "IfishDeviceInfo.h"
#import "DeviceModel.h"
@interface XuToControlNameViewController : IfishDeviceControlNameBaseController
@property (nonatomic,assign) BOOL isNewdevice;
@end

View File

@ -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) {

View File

@ -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;
}

View File

@ -9,16 +9,18 @@
#import <Foundation/Foundation.h>
#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

View File

@ -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];

View File

@ -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

View File

@ -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<shijianArr.count; k++) {
@ -944,14 +1112,19 @@ static NSString *setTimerflag = @"SetTimerCell";
NSLog(@"ni hua dong tai kuai");
str=[NSString stringWithFormat:@"%ld",(long)self.waterInfmodel.remindcycle];
[_remindPic makeToast:@"请设置换水天数"];
NSString*title=@"请设置换水天数";
if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
title=@"请设置杀菌天数";
}
[_remindPic makeToast:title];
return;
}
cell.huanshuiDaylabel.text=[NSString stringWithFormat:@"%@天",str];
//
[IFISHHTTPTOOL setRemindWaterInfWith:self.currentdevice.deviceId
[IFISHHTTPTOOL setRemindWaterInfWith:[NSString stringWithFormat:@"%@_%@",self.currentdevice.deviceId,self.currentdevice.type]
waterRemind:@"1" remindCycle:str
huishuiShiJian:^(setRemindWaterModel *remindModel) {
@ -967,6 +1140,49 @@ static NSString *setTimerflag = @"SetTimerCell";
[_remindPic removeFromSuperview];
}
else if (_indexPath.section-2==_titieArr.count)
{
TemperatureSetCell*cell=[self.tableView cellForRowAtIndexPath:_indexPath];
NSString *str=_remindPic.picViewResultString;
if (str==nil) {
//str=@"1";
NSLog(@"ni hua dong tai kuai");
str=[NSString stringWithFormat:@"%ld",(long)self.waterInfmodel.remindcycle];
NSString*title=@"请设置换水天数";
if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
title=@"请设置杀菌天数";
}
[_remindPic makeToast:title];
return;
}
cell.temperaturelabel.text=[NSString stringWithFormat:@"%.1f℃",str.floatValue];
//
;
[_remindPic removeFromSuperview];
baseModel*tempModel=[[baseModel alloc]init];
tempModel.sendmacId =self.currentdevice.macAddress;
tempModel.resavemacId =self.currentdevice.macAddress;
tempModel.functionCode=@"0E";
tempModel.massagelegth=@"13";
int intString = [str intValue];
int newIntString=intString*10;
NSString*temp =[dataContorl tpIntStringToFourHex:newIntString];
NSString*minString=[NSString stringWithFormat:@"%@%@%%@",tempModel.description,temp,@"0000"];
NSLog(@"minstring = %@",minString);
NSData*tempData=[dataContorl stringToHexData:minString];
[[Socketsingleton sharedInstance] soketWriteData:tempData];
}
}
@ -1028,7 +1244,7 @@ static NSString *setTimerflag = @"SetTimerCell";
if (huanShuiSwitch.selected ==YES) {
//
huanShuiSwitch.selected =NO;
[IFISHHTTPTOOL setRemindWaterInfWith:self.currentdevice.deviceId
[IFISHHTTPTOOL setRemindWaterInfWith:[NSString stringWithFormat:@"%@_%@",self.currentdevice.deviceId,self.currentdevice.type]
waterRemind:@"1" remindCycle:picResult
huishuiShiJian:^(setRemindWaterModel *remindModel) {
self.nextChangeDateLabel=remindModel.remindDate;
@ -1042,7 +1258,7 @@ static NSString *setTimerflag = @"SetTimerCell";
}else{
//
huanShuiSwitch.selected =YES;
[IFISHHTTPTOOL setRemindWaterInfWith:self.currentdevice.deviceId
[IFISHHTTPTOOL setRemindWaterInfWith:[NSString stringWithFormat:@"%@_%@",self.currentdevice.deviceId,self.currentdevice.type]
waterRemind:@"0" remindCycle:picResult
huishuiShiJian:^(setRemindWaterModel *remindModel) {
@ -1159,7 +1375,7 @@ static NSString *setTimerflag = @"SetTimerCell";
}else {
[_timerModel.groupModelArr removeAllObjects];
}
[Xuanduo2DataUtility readTimerSocketDataWithBackMsgModel:_timerModel addWithBackStr:string1];
[Xuanduo2DataUtility readTimerSocketDataWithBackMsgModel:_timerModel addWithBackStr:string1 type:self.currentdevice.type];
NSMutableArray *dataArr = [self.timeDic objectForKey:_titieArr[_selectSection-2]];
[dataArr removeAllObjects];
[dataArr addObject:plusflag];
@ -1177,7 +1393,7 @@ static NSString *setTimerflag = @"SetTimerCell";
[self.tableView reloadData];
}
if ([readTimer isEqualToString:@"0108"] || [readTimer isEqualToString:@"0105"]) {
[Xuanduo2DataUtility readSocketDataWithBackMsgModel:self.dataModel addWithBackData:data];
[Xuanduo2DataUtility readSocketDataWithBackMsgModel:self.dataModel addWithBackData:data type:self.currentdevice.type];
[self refreshWithData:self.dataModel];
[self.XuTohud hidmyHud];
[self.indicatorView stopAnimating];

View File

@ -7,11 +7,15 @@
//
#import "WhiteNavBaseViewController.h"
#import "IfishP2PMonitorController.h"
NS_ASSUME_NONNULL_BEGIN
@interface Xuanduo2fController : WhiteNavBaseViewController
@property(nonatomic,strong) DeviceModel* currentDevice;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *waterLightTop;
@property (weak, nonatomic) IBOutlet UIButton *controlBtn;
@property (weak, nonatomic) IBOutlet UIButton *cameraBtn;
@end

View File

@ -26,6 +26,7 @@
#import "JHRefreshAmazingAniView.h"
#import "JHRefresh.h"
#import "searchDeviceModel.h"
#import "PetStoresViewController.h"
#define kBtnTag 100
@ -42,7 +43,7 @@
@property (weak, nonatomic) IBOutlet UILabel *jiareLabel;
@property (weak, nonatomic) IBOutlet UIButton *brandBtn;
@property (weak, nonatomic) IBOutlet UILabel *brandName;
@property (nonatomic ,strong) Xuanduo2Model *dataModel;
@property (nonatomic ,strong) Xuanduo2Model* dataModel;
@property (weak, nonatomic) IBOutlet UILabel *tempLabel;
@property (weak, nonatomic) IBOutlet UILabel *tipLabel;
@property (nonatomic, strong) NSTimer *switchTimer;
@ -79,6 +80,7 @@
[super viewDidLoad];
[self setup];
[self connect];
// Do any additional setup after loading the view from its nib.
}
@ -96,11 +98,52 @@
//
[_brandBtn sd_setBackgroundImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",kGetLogUrl,self.currentDevice.logo]] forState:UIControlStateNormal placeholderImage:[UIImage imageNamed:@"brandLogo_hold"]];
_brandName.text = self.currentDevice.brandName;
self.dataModel=nil;
[self initCHNames];
[Socketsingleton sharedInstance].communiteDelegate = self;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tempSwitch)];
// [self.tempLabel addGestureRecognizer:tap];
[self creatRefreshView];
//
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
self.imageView.image=[UIImage imageNamed:@"pet"];
self.waterLightTop.constant=55;
//
[self.waterLight setBackgroundImage:[UIImage imageNamed:@"照明关"] forState:UIControlStateNormal];
[self.waterLight setBackgroundImage:[UIImage imageNamed:@"照明开"] forState:UIControlStateSelected];
// self.xunhuanLabel.text=@"照明";
//
[self.gasPumpLight setBackgroundImage:[UIImage imageNamed:@"换气关"] forState:UIControlStateNormal];
[self.gasPumpLight setBackgroundImage:[UIImage imageNamed:@"换气开"] forState:UIControlStateSelected];
// self.zengyangLabel.text=@"换气";
//
[self.light1 setBackgroundImage:[UIImage imageNamed:@"杀菌关"] forState:UIControlStateNormal];
[self.light1 setBackgroundImage:[UIImage imageNamed:@"杀菌开"] forState:UIControlStateSelected];
// self.light1Label.text=@"杀菌";
//
[self.light2 setBackgroundImage:[UIImage imageNamed:@"恒温关"] forState:UIControlStateNormal];
[self.light2 setBackgroundImage:[UIImage imageNamed:@"恒温开"] forState:UIControlStateSelected];
// self.light2Label.text=@"恒温";
self.tipLabel.text=@"宠物笼温度";
self.controlBtn.hidden=NO;
self.cameraBtn.hidden=NO;
self.waveLight.hidden=YES;
self.zaolangLabel.hidden=YES;
self.uvLight.hidden=YES;
self.shajunLight.hidden=YES;
self.huliLight.hidden=YES;
self.huliLabel.hidden=YES;
self.heatLight.hidden=YES;
self.jiareLabel.hidden=YES;
}
}
- (void)connect {
@ -159,8 +202,9 @@
//[[Socketsingleton sharedInstance];
}
//
[[Socketsingleton sharedInstance] socketConnectHost];
[Socketsingleton sharedInstance].macAddress = self.currentDevice.macAddress;
[[Socketsingleton sharedInstance] socketConnectHost];
}
#pragma mark communiteDelegate
@ -211,16 +255,19 @@
[self.XuTohud hidmyHud];
[self endRefreshing];
NSLog(@"123124124");
[Xuanduo2DataUtility readSocketDataWithBackMsgModel:self.dataModel addWithBackData:data];
if ([self.tipLabel.text isEqualToString:@"鱼缸温度"]) {
[Xuanduo2DataUtility readSocketDataWithBackMsgModel:self.dataModel addWithBackData:data type:self.currentDevice.type];
[self setTemperature];
}
if (self.dataModel.gasPump) {
if (self.dataModel) {
_offLineLabel.hidden = YES;
}else {
_offLineLabel.hidden = NO;
}
[Xuanduo2DataUtility resetNewXuanduoButtonState:self.uvLight gasPumpLight:self.gasPumpLight light1:self.light1 light2:self.light2 waveLight:self.waveLight huliLight:self.huliLight waterLight:self.waterLight heatLight:self.heatLight withModel:self.dataModel];
[Xuanduo2DataUtility resetNewXuanduoButtonState:self.uvLight gasPumpLight:self.gasPumpLight light1:self.light1 light2:self.light2 waveLight:self.waveLight huliLight:self.huliLight waterLight:self.waterLight heatLight:self.heatLight withModel:self.dataModel type:self.currentDevice.type];
}
-(void)ifishDeviceLogInFail{
@ -237,6 +284,70 @@
#pragma mark -- actions --
- (IBAction)cameraBtnClick:(id)sender {
NSMutableArray *guanxiiArr= [[DataCenter defaultDtacenter] valueForKey:@"devicamerArr"];
NSString*cameraId=nil;
for (DeviceCameraModel *model in guanxiiArr) {
if (model.deviceId == self.currentDevice.deviceId ) {
cameraId=model.cameraId;
break;
}
}
if (cameraId)
{
IfishCameraModel *camera;
NSArray*array=[[DataCenter defaultDtacenter]valueForKey:@"cameraArr"];
for (IfishCameraModel*model in array) {
if ([model.cameraId isEqualToString:cameraId])
{
camera=model;
break;
}
}
if (camera)
{
[[Socketsingleton sharedInstance] cutOffSocket];
//
IfishP2PMonitorController *p2pVC=[[IfishP2PMonitorController alloc] init];
p2pVC.contact = camera;
[self.navigationController pushViewController:p2pVC animated:YES];
}
else
{
[self.view makeToast:@"暂无关联的摄像头"];
}
}
else
{
[self.view makeToast:@"暂无关联的摄像头"];
}
}
- (IBAction)controlBtnClick:(id)sender {
FormatTankAddCamera*model=[[DataCenter defaultDtacenter] valueForKey:@"currentStore"];
if (model)
{
PetStoresViewController*store=[[PetStoresViewController alloc]init];
store.store=model;
;
self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:store animated:YES];
}
}
- (IBAction)btnActions:(UIButton *)btn {
if (self.dataModel.gasPump) {
@ -256,33 +367,56 @@
switch (btn.tag) {
case kBtnTag: //
{
if (btn.selected) {
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:@"确认关闭循环泵?" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:nil];
UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[self changLightStatus:lightModel withLightNumber:@"04" dataStr:switchString1];
}];
[alertController addAction:cancelAction];
[alertController addAction:sureAction];
[self.navigationController presentViewController:alertController animated:YES completion:nil];
}else {
[self changLightStatus:lightModel withLightNumber:@"04" dataStr:switchString1];
if([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
[self changLightStatus:lightModel withLightNumber:@"01" dataStr:switchString1];
}
else{
if (btn.selected) {
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:@"确认关闭循环泵?" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:nil];
UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[self changLightStatus:lightModel withLightNumber:@"04" dataStr:switchString1];
}];
[alertController addAction:cancelAction];
[alertController addAction:sureAction];
[self.navigationController presentViewController:alertController animated:YES completion:nil];
}else {
[self changLightStatus:lightModel withLightNumber:@"04" dataStr:switchString1];
}
}
}
break;
case kBtnTag + 1: //
{
[self changLightStatus:lightModel withLightNumber:@"01" dataStr:switchString1];
NSString*light=@"01";
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
light=@"02";
}
[self changLightStatus:lightModel withLightNumber:light dataStr:switchString1];
}
break;
case kBtnTag + 2: //1
{
[self changLightStatus:lightModel withLightNumber:@"02" dataStr:switchString1];
NSString*light=@"02";
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
light=@"03";
}
[self changLightStatus:lightModel withLightNumber:light dataStr:switchString1];
}
break;
case kBtnTag + 3: //2
{
[self changLightStatus:lightModel withLightNumber:@"03" dataStr:switchString1];
NSString*light=@"03";
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
light=@"04";
}
[self changLightStatus:lightModel withLightNumber:light dataStr:switchString1];
}
break;
case kBtnTag + 4: //
@ -327,10 +461,21 @@
[self.view.window addSubview:_wenduPicview];
_wenduPicview.wenDuPicviewDelegate = self;
NSString *stateStr =nil;
if ([self.dataModel.status isKindOfClass:[NSNull class]]||!self.dataModel.status ) {
self.dataModel.status = @"0000";
NSString*status;
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO2F])
{
status=((Xuanduo2Model*)self.dataModel).status;
}
stateStr = [self.dataModel.status substringWithRange:NSMakeRange(2, 2)];
else if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
status=((Xuanduo3fModel*)self.dataModel).constTmep;
}
if ([status isKindOfClass:[NSNull class]]||status ) {
status = @"0000";
}
stateStr = [status substringWithRange:NSMakeRange(2, 2)];
[_wenduPicview initCateBtnSate:stateStr];
[self heatAction];
@ -378,7 +523,17 @@
- (void)heatAction
{
UInt64 mac=[dataContorl hexToTen:self.dataModel.heatingTemperature];
UInt64 mac=0;
NSLog(@"%llu",mac);
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO2F]) {
Xuanduo2Model*model=(Xuanduo2Model*)self.dataModel;
mac=[dataContorl hexToTen:model.heatingTemperature];
}
else if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
Xuanduo3fModel*model=(Xuanduo3fModel*)self.dataModel;
mac=[dataContorl hexToTen:model.heatingTemperature];
}
NSLog(@"%llu",mac);
float TPlabel=mac/10;
int temp= (int)(TPlabel+0.5);
@ -444,7 +599,15 @@
}else {
self.tipLabel.text = @"当月电量";
UInt64 mac = [dataContorl hexToTen:self.dataModel.electricity];
UInt64 mac = 0;
NSLog(@"%llu",mac);
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO2F]) {
Xuanduo2Model*model=(Xuanduo2Model*)self.dataModel;
mac=[dataContorl hexToTen:model.electricity];
}
else if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
}
NSString *stringTemp = [NSString stringWithFormat:@"%llukwh",mac/10.0];
[self.tempLabel setAttributedText:[NSString ls_changeFontAndColor:[UIFont systemFontOfSize:15] Color:nil TotalString:stringTemp SubStringArray:@[@"kwh"]]];
if (!_switchTimer) {
@ -455,7 +618,15 @@
}
- (void)changeTemp {
self.tipLabel.text = @"鱼缸温度";
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO2F]) {
self.tipLabel.text = @"鱼缸温度";
}
else if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
self.tipLabel.text = @"宠物笼温度";
}
[self setTemperature];
[_switchTimer invalidate];
_switchTimer = nil;
@ -478,6 +649,13 @@
titleImgs = @[@"ifishdropview_edite_device",@"ifishdropview_delect_device",@"Ifish_share_device",@"ifishdropview_set_device"];
titles=@[@"修改名称",@"删除设备",@"分享设备",@"鱼缸设置"];
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) {
titles=@[@"修改名称",@"删除设备",@"分享设备",@"宠物笼设置"];
}
pop.delegate = self;
pop.backgroundImage =image
@ -538,8 +716,18 @@
#pragma mark -
- (void)setTemperature {
UInt64 mac = [dataContorl hexToTen:self.dataModel.waterTemperature];
UInt64 mac = 0;
NSLog(@"%llu",mac);
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO2F]) {
Xuanduo2Model*model=(Xuanduo2Model*)self.dataModel;
mac=[dataContorl hexToTen:model.waterTemperature];
}
else if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
Xuanduo3fModel*model=(Xuanduo3fModel*)self.dataModel;
mac=[dataContorl hexToTen:model.temperature];
}
//float TPlabel=mac/10+(mac%10)*0.1;
float temp = mac/10.0;
NSString *stringTemp = [NSString stringWithFormat:@"%.1f℃",temp];
@ -563,6 +751,10 @@
-(void)initCHNames{
XuToControlName *name = [UserExtendataArchaver currentNewXuToControlName:self.currentDevice.macAddress];
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
name=[UserExtendataArchaver currentPetsXuToControlName:self.currentDevice.macAddress];
}
self.shajunLight.text = name.shajunLight;
self.zengyangLabel.text = name.zengyangPump;
self.light1Label.text = name.light1;
@ -719,9 +911,17 @@
}
- (Xuanduo2Model *)dataModel {
- (id)dataModel {
if (!_dataModel) {
_dataModel = [Xuanduo2Model new];
_dataModel = nil;
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO2F]) {
_dataModel=[[Xuanduo2Model alloc]init];
}
else if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
_dataModel=[[Xuanduo3fModel alloc]init];
}
}
return _dataModel;
}

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_0" orientation="portrait">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
@ -14,7 +14,9 @@
<connections>
<outlet property="brandBtn" destination="KcF-jg-Mz2" id="90Z-SG-zCz"/>
<outlet property="brandName" destination="pjU-4c-KIu" id="7o4-eb-hHX"/>
<outlet property="cameraBtn" destination="iCh-CK-V5y" id="guD-Hq-sdu"/>
<outlet property="contentView" destination="aik-7S-q8v" id="uIf-SZ-FJV"/>
<outlet property="controlBtn" destination="ASo-hi-5ge" id="qfX-CB-Urm"/>
<outlet property="gasPumpLight" destination="ZVe-ED-kl7" id="mbB-kR-vdN"/>
<outlet property="heatLight" destination="fFJ-1w-2f5" id="SYo-Yn-tUf"/>
<outlet property="huliLabel" destination="7KA-Hc-54C" id="jOn-NM-fyy"/>
@ -34,6 +36,7 @@
<outlet property="uvLight" destination="ucP-6q-kgn" id="h0M-05-ZQd"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
<outlet property="waterLight" destination="94R-4Q-SUx" id="sLi-lF-GPC"/>
<outlet property="waterLightTop" destination="kES-AW-PEh" id="AEG-4b-dSg"/>
<outlet property="waveLight" destination="83l-yl-ndR" id="Ppq-0b-uJB"/>
<outlet property="xunhuanLabel" destination="zRG-Xz-MbP" id="jCW-ap-zLb"/>
<outlet property="zaolangLabel" destination="BWx-iu-nY0" id="rxl-X0-mne"/>
@ -42,29 +45,50 @@
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="H1f-gs-HPh">
<rect key="frame" x="0.0" y="20" width="320" height="548"/>
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aik-7S-q8v" userLabel="Content View">
<rect key="frame" x="0.0" y="0.0" width="320" height="775"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="802.5"/>
<subviews>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ASo-hi-5ge">
<rect key="frame" x="20" y="280" width="80" height="20"/>
<color key="backgroundColor" red="0.96078431372549022" green="0.66666666666666663" blue="0.73725490196078436" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="width" constant="80" id="JOT-JM-Hx8"/>
<constraint firstAttribute="height" constant="20" id="XQI-fM-m1M"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<state key="normal" title="切换控制器">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="5"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="controlBtnClick:" destination="-1" eventType="touchUpInside" id="3SB-mH-S1M"/>
</connections>
</button>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="xuanduo_bg" translatesAutoresizingMaskIntoConstraints="NO" id="EVp-Sm-Feq">
<rect key="frame" x="0.0" y="0.0" width="320" height="300"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="300"/>
<constraints>
<constraint firstAttribute="height" constant="300" id="V9N-xo-Uzm"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="鱼缸温度" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vcu-MT-d6F">
<rect key="frame" x="129" y="314" width="62" height="18"/>
<rect key="frame" x="156.5" y="314" width="62" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" tag="100" contentMode="scaleAspectFit" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="94R-4Q-SUx">
<rect key="frame" x="30" y="372" width="35" height="35"/>
<rect key="frame" x="30" y="372" width="49" height="49"/>
<constraints>
<constraint firstAttribute="width" secondItem="94R-4Q-SUx" secondAttribute="height" multiplier="1:1" id="zkk-3F-Fut"/>
</constraints>
@ -75,7 +99,7 @@
</connections>
</button>
<button opaque="NO" tag="101" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZVe-ED-kl7">
<rect key="frame" x="105" y="372" width="35" height="35"/>
<rect key="frame" x="119" y="372" width="48.5" height="49"/>
<constraints>
<constraint firstAttribute="width" secondItem="ZVe-ED-kl7" secondAttribute="height" multiplier="1:1" id="Nyb-kW-maB"/>
</constraints>
@ -86,7 +110,7 @@
</connections>
</button>
<button opaque="NO" tag="102" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="WFc-cF-80l">
<rect key="frame" x="180" y="372" width="35" height="35"/>
<rect key="frame" x="207.5" y="372" width="49" height="49"/>
<constraints>
<constraint firstAttribute="width" secondItem="WFc-cF-80l" secondAttribute="height" multiplier="1:1" id="KNO-vi-GYn"/>
</constraints>
@ -97,7 +121,7 @@
</connections>
</button>
<button opaque="NO" tag="103" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="RHd-Xx-AyG">
<rect key="frame" x="255" y="372" width="35" height="35"/>
<rect key="frame" x="296.5" y="372" width="48.5" height="49"/>
<constraints>
<constraint firstAttribute="width" secondItem="RHd-Xx-AyG" secondAttribute="height" multiplier="1:1" id="npW-2w-QHd"/>
</constraints>
@ -108,31 +132,31 @@
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="循环泵" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zRG-Xz-MbP">
<rect key="frame" x="29" y="411" width="37" height="15"/>
<rect key="frame" x="36" y="425" width="37" height="15"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="增氧泵" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Dse-Ih-U5R">
<rect key="frame" x="104" y="411" width="37" height="15"/>
<rect key="frame" x="124.5" y="425" width="37" height="15"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="灯光1" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="w1W-F8-kDG">
<rect key="frame" x="182" y="411" width="31" height="15"/>
<rect key="frame" x="216.5" y="425" width="31" height="15"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="灯光2" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="k4O-MJ-aZd">
<rect key="frame" x="256.5" y="411" width="32" height="15"/>
<rect key="frame" x="304.5" y="425" width="32" height="15"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" tag="104" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="83l-yl-ndR">
<rect key="frame" x="30" y="451" width="35" height="35"/>
<rect key="frame" x="30" y="465" width="49" height="48.5"/>
<constraints>
<constraint firstAttribute="width" secondItem="83l-yl-ndR" secondAttribute="height" multiplier="1:1" id="w6a-qu-5EK"/>
</constraints>
@ -143,7 +167,7 @@
</connections>
</button>
<button opaque="NO" tag="105" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ucP-6q-kgn">
<rect key="frame" x="105" y="451" width="35" height="35"/>
<rect key="frame" x="119" y="465" width="48.5" height="48.5"/>
<constraints>
<constraint firstAttribute="width" secondItem="ucP-6q-kgn" secondAttribute="height" multiplier="1:1" id="Vkv-7O-YZz"/>
</constraints>
@ -154,7 +178,7 @@
</connections>
</button>
<button opaque="NO" tag="106" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="wZH-6A-6dN">
<rect key="frame" x="180" y="451" width="35" height="35"/>
<rect key="frame" x="207.5" y="465" width="49" height="48.5"/>
<constraints>
<constraint firstAttribute="width" secondItem="wZH-6A-6dN" secondAttribute="height" multiplier="1:1" id="526-Hn-VeS"/>
</constraints>
@ -165,7 +189,7 @@
</connections>
</button>
<button opaque="NO" tag="107" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fFJ-1w-2f5">
<rect key="frame" x="255" y="451" width="35" height="35"/>
<rect key="frame" x="296.5" y="465" width="48.5" height="48.5"/>
<constraints>
<constraint firstAttribute="width" secondItem="fFJ-1w-2f5" secondAttribute="height" multiplier="1:1" id="4jg-CV-sDI"/>
</constraints>
@ -176,31 +200,31 @@
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="造浪泵" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BWx-iu-nY0">
<rect key="frame" x="29" y="490" width="37" height="15"/>
<rect key="frame" x="36" y="517.5" width="37" height="15"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="杀菌灯" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="OLb-WT-tQ0">
<rect key="frame" x="104" y="490" width="37" height="15"/>
<rect key="frame" x="124.5" y="517.5" width="37" height="15"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="护理灯" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7KA-Hc-54C">
<rect key="frame" x="179" y="490" width="37" height="15"/>
<rect key="frame" x="213.5" y="517.5" width="37" height="15"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="加热棒" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="r24-bR-0zZ">
<rect key="frame" x="254" y="490" width="37" height="15"/>
<rect key="frame" x="302" y="517.5" width="37" height="15"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="G1c-II-WK8">
<rect key="frame" x="220" y="0.0" width="100" height="44"/>
<rect key="frame" x="275" y="0.0" width="100" height="44"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="100" id="cOL-94-UdY"/>
@ -208,7 +232,7 @@
</constraints>
</view>
<label opaque="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0 ℃" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="brS-3x-RcE">
<rect key="frame" x="115" y="209" width="90" height="90"/>
<rect key="frame" x="142.5" y="209" width="90" height="90"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="90" id="GQu-NL-cde"/>
@ -240,7 +264,7 @@
<nil key="highlightedColor"/>
</label>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="设备已离线" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Jp2-HW-vcX">
<rect key="frame" x="120" y="338" width="80" height="25"/>
<rect key="frame" x="147.5" y="338" width="80" height="25"/>
<color key="backgroundColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="80" id="gtN-UH-BAO"/>
@ -254,15 +278,35 @@
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
</userDefinedRuntimeAttributes>
</label>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="iCh-CK-V5y" userLabel="切换摄像头">
<rect key="frame" x="275" y="280" width="80" height="20"/>
<color key="backgroundColor" red="0.96078431369999995" green="0.66666666669999997" blue="0.73725490199999999" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<state key="normal" title="切换摄像头">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="5"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="cameraBtnClick:" destination="-1" eventType="touchUpInside" id="xg3-9Y-gT8"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="WFc-cF-80l" firstAttribute="top" secondItem="ZVe-ED-kl7" secondAttribute="top" id="0BY-oG-gcd"/>
<constraint firstItem="ASo-hi-5ge" firstAttribute="top" secondItem="EVp-Sm-Feq" secondAttribute="bottom" constant="-20" id="0bJ-eb-80r"/>
<constraint firstItem="ZVe-ED-kl7" firstAttribute="width" secondItem="94R-4Q-SUx" secondAttribute="width" id="3se-2R-nR8"/>
<constraint firstItem="vcu-MT-d6F" firstAttribute="top" secondItem="brS-3x-RcE" secondAttribute="bottom" constant="15" id="4B2-Mr-ob3"/>
<constraint firstItem="OLb-WT-tQ0" firstAttribute="top" secondItem="ucP-6q-kgn" secondAttribute="bottom" constant="4" id="4Bf-gm-YTx"/>
<constraint firstItem="pjU-4c-KIu" firstAttribute="top" secondItem="KcF-jg-Mz2" secondAttribute="bottom" constant="8" id="4U0-5n-ux5"/>
<constraint firstItem="iCh-CK-V5y" firstAttribute="width" secondItem="ASo-hi-5ge" secondAttribute="width" id="4yK-Q4-cCT"/>
<constraint firstItem="k4O-MJ-aZd" firstAttribute="top" secondItem="RHd-Xx-AyG" secondAttribute="bottom" constant="4" id="6Bg-et-4ju"/>
<constraint firstItem="iCh-CK-V5y" firstAttribute="top" secondItem="ASo-hi-5ge" secondAttribute="top" id="7mh-MV-e13"/>
<constraint firstItem="G1c-II-WK8" firstAttribute="top" secondItem="aik-7S-q8v" secondAttribute="top" id="83E-pJ-8Fg"/>
<constraint firstItem="ucP-6q-kgn" firstAttribute="top" secondItem="83l-yl-ndR" secondAttribute="top" id="9Cs-Lk-q7I"/>
<constraint firstItem="RHd-Xx-AyG" firstAttribute="width" secondItem="94R-4Q-SUx" secondAttribute="width" id="A2B-qb-Kn1"/>
@ -277,6 +321,7 @@
<constraint firstAttribute="bottom" secondItem="BWx-iu-nY0" secondAttribute="bottom" constant="270" id="Gmu-GA-a15"/>
<constraint firstItem="fFJ-1w-2f5" firstAttribute="centerY" secondItem="wZH-6A-6dN" secondAttribute="centerY" id="HUF-tX-xdo"/>
<constraint firstItem="94R-4Q-SUx" firstAttribute="leading" secondItem="aik-7S-q8v" secondAttribute="leading" constant="30" id="Hif-9z-wed"/>
<constraint firstAttribute="trailing" secondItem="iCh-CK-V5y" secondAttribute="trailing" constant="20" id="Ijl-Sy-Qe7"/>
<constraint firstItem="OLb-WT-tQ0" firstAttribute="centerX" secondItem="ucP-6q-kgn" secondAttribute="centerX" id="LF8-uL-oh2"/>
<constraint firstItem="BWx-iu-nY0" firstAttribute="centerX" secondItem="83l-yl-ndR" secondAttribute="centerX" id="LSK-ci-U11"/>
<constraint firstItem="WFc-cF-80l" firstAttribute="width" secondItem="94R-4Q-SUx" secondAttribute="width" id="LyZ-Sb-suz"/>
@ -312,11 +357,13 @@
<constraint firstItem="fFJ-1w-2f5" firstAttribute="width" secondItem="fFJ-1w-2f5" secondAttribute="height" multiplier="1:1" id="ns1-lf-YQG"/>
<constraint firstItem="Jp2-HW-vcX" firstAttribute="top" secondItem="vcu-MT-d6F" secondAttribute="bottom" constant="6" id="pYZ-Gz-Cgr"/>
<constraint firstItem="ucP-6q-kgn" firstAttribute="width" secondItem="ucP-6q-kgn" secondAttribute="height" multiplier="1:1" id="q0b-Ok-bD1"/>
<constraint firstItem="iCh-CK-V5y" firstAttribute="height" secondItem="ASo-hi-5ge" secondAttribute="height" id="qYH-W0-hlN"/>
<constraint firstAttribute="trailing" secondItem="fFJ-1w-2f5" secondAttribute="trailing" constant="30" id="s7v-x0-Wl5"/>
<constraint firstItem="KcF-jg-Mz2" firstAttribute="top" secondItem="aik-7S-q8v" secondAttribute="top" constant="18" id="tdu-Q3-j07"/>
<constraint firstAttribute="trailing" secondItem="G1c-II-WK8" secondAttribute="trailing" id="teN-7B-Npa"/>
<constraint firstItem="RHd-Xx-AyG" firstAttribute="centerY" secondItem="WFc-cF-80l" secondAttribute="centerY" id="tpr-qz-KT0"/>
<constraint firstItem="vcu-MT-d6F" firstAttribute="centerX" secondItem="aik-7S-q8v" secondAttribute="centerX" id="uKM-H9-GFY"/>
<constraint firstItem="ASo-hi-5ge" firstAttribute="leading" secondItem="aik-7S-q8v" secondAttribute="leading" constant="20" id="vtm-ny-RWe"/>
<constraint firstItem="ucP-6q-kgn" firstAttribute="width" secondItem="83l-yl-ndR" secondAttribute="width" id="wEN-Jf-FpP"/>
<constraint firstItem="brS-3x-RcE" firstAttribute="top" secondItem="EVp-Sm-Feq" secondAttribute="bottom" constant="-91" id="wy8-b5-lgU"/>
<constraint firstItem="wZH-6A-6dN" firstAttribute="width" secondItem="83l-yl-ndR" secondAttribute="width" id="x5W-Jy-Jg5"/>

View File

@ -0,0 +1,55 @@
//
// xuanduo3fModel.h
// Ifish
//
// Created by 祝发冬 on 2020/4/6.
// Copyright © 2020 lianlian. All rights reserved.
//
#import <Foundation/Foundation.h>
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

View File

@ -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

View File

@ -7,6 +7,7 @@
//
#import "BaseViewController.h"
#import "IfishDeviceInfo.h"
//修改设备名 及控制名 子类实现DataSource即可
typedef void (^deviceNameBlock)(NSString *);

View File

@ -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];

View File

@ -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;

View File

@ -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) {

View File

@ -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

View File

@ -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:@"敬请期待"];
}

View File

@ -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;

View File

@ -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 ()<UITableViewDelegate,UITableViewDataSource,LxPopViewDelegate,ShopTtemListDelegate>
@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];

View File

@ -1,12 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@ -20,14 +19,14 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="THd-Bu-zD5">
<rect key="frame" x="17" y="10" width="89" height="75"/>
<rect key="frame" x="25" y="10" width="89" height="75"/>
<constraints>
<constraint firstAttribute="width" constant="89" id="0Pc-4E-ufb"/>
<constraint firstAttribute="height" constant="75" id="KcI-Vb-QWI"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="内容摘要" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="j2f-hz-gt7">
<rect key="frame" x="114" y="33" width="198" height="15"/>
<rect key="frame" x="122" y="33" width="182" height="15"/>
<constraints>
<constraint firstAttribute="height" constant="15" id="Mem-ah-ew5"/>
</constraints>
@ -36,7 +35,7 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="标题栏" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JgQ-HP-X5l">
<rect key="frame" x="114" y="10" width="198" height="21"/>
<rect key="frame" x="122" y="10" width="182" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="BEA-GV-KLN"/>
</constraints>
@ -45,21 +44,21 @@
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="21M-GY-1ue">
<rect key="frame" x="0.0" y="94" width="320" height="1"/>
<rect key="frame" x="0.0" y="93.5" width="320" height="1"/>
<color key="backgroundColor" red="0.83529411764705885" green="0.83529411764705885" blue="0.83529411764705885" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="Swk-c6-aZl"/>
</constraints>
</view>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="informationlist_view.png" translatesAutoresizingMaskIntoConstraints="NO" id="4WM-Lf-mP1">
<rect key="frame" x="208" y="69" width="20" height="12"/>
<rect key="frame" x="200" y="66.5" width="20" height="12"/>
<constraints>
<constraint firstAttribute="height" constant="12" id="5Q6-5Z-GhG"/>
<constraint firstAttribute="width" constant="20" id="kt8-Rt-4lN"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1000" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8BV-KU-YQ2">
<rect key="frame" x="234.5" y="64" width="28.5" height="20"/>
<rect key="frame" x="226.5" y="61.5" width="28.5" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="CWc-Pp-MZi"/>
</constraints>
@ -68,7 +67,7 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="10" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tos-bK-aju">
<rect key="frame" x="298.5" y="65" width="13.5" height="20"/>
<rect key="frame" x="290.5" y="62.5" width="13.5" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="aPb-az-2hG"/>
</constraints>
@ -77,7 +76,7 @@
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="informationlist_comment.png" translatesAutoresizingMaskIntoConstraints="NO" id="akZ-xg-M7C">
<rect key="frame" x="278" y="69" width="16" height="13"/>
<rect key="frame" x="270" y="66.5" width="16" height="13"/>
<constraints>
<constraint firstAttribute="height" constant="13" id="jI9-LF-fAx"/>
<constraint firstAttribute="width" constant="16" id="jlO-wX-UXc"/>
@ -105,6 +104,11 @@
<constraint firstItem="j2f-hz-gt7" firstAttribute="top" secondItem="JgQ-HP-X5l" secondAttribute="bottom" constant="2" id="fgL-3A-GSX"/>
<constraint firstAttribute="trailingMargin" secondItem="JgQ-HP-X5l" secondAttribute="trailing" id="vgK-9J-52g"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
<color key="value" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</tableViewCellContentView>
<connections>
<outlet property="detailLabe" destination="j2f-hz-gt7" id="Qgk-YF-MRi"/>

View File

@ -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];
}
}

View File

@ -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{

View File

@ -197,7 +197,8 @@ typedef NS_ENUM(NSUInteger, SmartDeviceType) {
DEVICEAQUARIUM ,
/// 加热
DEVICEHEATING
DEVICEHEATING,
DEVICEPETS
};
#define Ali_Push_APPKey @"26007228"
#define Ali_Push_APPSecret @"87c9206424399968ba11a56a9a979cfe"

View File

@ -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;

View File

@ -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"]) {

View File

@ -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<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (nonatomic, strong) FormatTankAddCamera *store;//一个商店的
@end
NS_ASSUME_NONNULL_END

View File

@ -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

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="PetStoresViewController">
<connections>
<outlet property="tableView" destination="dhT-8j-hrA" id="VhX-4j-Uvk"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="dhT-8j-hrA">
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
<outlet property="dataSource" destination="-1" id="UHm-GH-hbe"/>
<outlet property="delegate" destination="-1" id="Ys8-LQ-Ktl"/>
</connections>
</tableView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="Q5M-cg-NOt" firstAttribute="bottom" secondItem="dhT-8j-hrA" secondAttribute="bottom" id="DcW-H0-oBU"/>
<constraint firstItem="dhT-8j-hrA" firstAttribute="top" secondItem="Q5M-cg-NOt" secondAttribute="top" id="NkU-Tn-cRf"/>
<constraint firstItem="dhT-8j-hrA" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" id="PqU-7d-pW9"/>
<constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="dhT-8j-hrA" secondAttribute="trailing" id="W0H-iW-gLe"/>
</constraints>
<viewLayoutGuide key="safeArea" id="Q5M-cg-NOt"/>
</view>
</objects>
</document>

View File

@ -86,6 +86,7 @@
@property(nonatomic,copy) NSString *userId;
@property(nonatomic,copy) NSString *venderDto;
@property (nonatomic, strong) NSString *storeName;//宠物店
// 厂家 信息vender
//厂家

View File

@ -121,6 +121,7 @@
_isPushWendu = dict[@"isPushWendu"];
_venderDto=dict[@"venderDto"];
_deviceIp=dict[@"deviceIp"];
_storeName=dict[@"storeName"];
if ([_venderDto isEqual:[NSNull null]]) {
_venderDto=@"";

View File

@ -8,7 +8,7 @@
#import <Foundation/Foundation.h>
@interface UserModel : NSObject
@interface UserModel : NSObject<NSCoding>
@property(nonatomic,copy)NSString*phoneNumber;
@property(nonatomic,strong)NSNumber*userId;

View File

@ -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

View File

@ -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

View File

@ -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;
}

View File

@ -0,0 +1,32 @@
//
// StoreNameView.h
// Ifish
//
// Created by 祝发冬 on 2020/4/20.
// Copyright © 2020 lianlian. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "LXPopView.h"
#import "DXPopover.h"
#import "AppDelegate.h"
NS_ASSUME_NONNULL_BEGIN
@interface StoreNameView : UIView<UITextFieldDelegate,UITableViewDelegate,UITableViewDataSource>
@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

156
Ifish/views/StoreNameView.m Normal file
View File

@ -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

View File

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view autoresizesSubviews="NO" contentMode="scaleToFill" id="iN0-l3-epB" customClass="StoreNameView">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="确认宠物店" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Xma-OD-U5k">
<rect key="frame" x="0.0" y="0.0" width="375" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="69g-fb-1g0"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="新增宠物店" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aXJ-p7-oyj">
<rect key="frame" x="20" y="55" width="335" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="Xh2-xx-l5K"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="选择已有宠物店" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BhC-qC-LQP">
<rect key="frame" x="20" y="131" width="335" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="GIW-cD-aCF"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Lua-1g-dWJ" userLabel="name">
<rect key="frame" x="20" y="86" width="335" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="hdU-TO-9n8"/>
</constraints>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="4fu-eE-Cen" userLabel="oldName">
<rect key="frame" x="20" y="162" width="335" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="8Pc-yH-bm5"/>
</constraints>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" tag="2" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ohE-i9-kyM">
<rect key="frame" x="255" y="207" width="60" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="DAg-mH-UQg"/>
<constraint firstAttribute="width" constant="60" id="LiE-Bd-jKO"/>
</constraints>
<state key="normal" title="确定">
<color key="titleColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
</button>
<button opaque="NO" tag="1" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Caw-lq-KG3">
<rect key="frame" x="60" y="207" width="60" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="Xs2-Ay-F82"/>
<constraint firstAttribute="width" constant="60" id="jpe-aw-asa"/>
</constraints>
<state key="normal" title="取消">
<color key="titleColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="Lua-1g-dWJ" firstAttribute="trailing" secondItem="aXJ-p7-oyj" secondAttribute="trailing" id="18y-Uf-rZF"/>
<constraint firstItem="BhC-qC-LQP" firstAttribute="top" secondItem="Lua-1g-dWJ" secondAttribute="bottom" constant="15" id="3xA-Sx-zmg"/>
<constraint firstAttribute="trailing" secondItem="ohE-i9-kyM" secondAttribute="trailing" constant="60" id="56t-VZ-WQJ"/>
<constraint firstItem="Caw-lq-KG3" firstAttribute="top" secondItem="4fu-eE-Cen" secondAttribute="bottom" constant="15" id="FXq-wn-PQO"/>
<constraint firstItem="Xma-OD-U5k" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="Gli-0E-S2Z"/>
<constraint firstItem="Lua-1g-dWJ" firstAttribute="leading" secondItem="aXJ-p7-oyj" secondAttribute="leading" id="HFM-Nc-OUh"/>
<constraint firstAttribute="trailing" secondItem="aXJ-p7-oyj" secondAttribute="trailing" constant="20" id="IZn-CA-VVK"/>
<constraint firstItem="4fu-eE-Cen" firstAttribute="leading" secondItem="Lua-1g-dWJ" secondAttribute="leading" id="Itq-9x-8ln"/>
<constraint firstItem="aXJ-p7-oyj" firstAttribute="top" secondItem="Xma-OD-U5k" secondAttribute="bottom" constant="5" id="JTf-DK-HBe"/>
<constraint firstItem="Xma-OD-U5k" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="Mr0-BK-5WJ"/>
<constraint firstItem="4fu-eE-Cen" firstAttribute="top" secondItem="BhC-qC-LQP" secondAttribute="bottom" constant="10" id="PhV-ha-1Q0"/>
<constraint firstItem="aXJ-p7-oyj" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" id="T14-0j-TSb"/>
<constraint firstItem="Lua-1g-dWJ" firstAttribute="top" secondItem="aXJ-p7-oyj" secondAttribute="bottom" constant="10" id="VKG-TI-vuY"/>
<constraint firstItem="BhC-qC-LQP" firstAttribute="leading" secondItem="Lua-1g-dWJ" secondAttribute="leading" id="ViC-BE-t66"/>
<constraint firstItem="ohE-i9-kyM" firstAttribute="top" secondItem="4fu-eE-Cen" secondAttribute="bottom" constant="15" id="aMk-xg-b0F"/>
<constraint firstAttribute="trailing" secondItem="Xma-OD-U5k" secondAttribute="trailing" id="cOo-TT-cQW"/>
<constraint firstItem="4fu-eE-Cen" firstAttribute="trailing" secondItem="Lua-1g-dWJ" secondAttribute="trailing" id="caY-rY-tJK"/>
<constraint firstItem="BhC-qC-LQP" firstAttribute="trailing" secondItem="Lua-1g-dWJ" secondAttribute="trailing" id="odD-At-FPv"/>
<constraint firstItem="Caw-lq-KG3" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="60" id="t3d-aE-C47"/>
</constraints>
<connections>
<outlet property="cancelButton" destination="Caw-lq-KG3" id="rnc-iz-wGl"/>
<outlet property="createStoreLabel" destination="aXJ-p7-oyj" id="Qq5-hR-Q4q"/>
<outlet property="oldLabel" destination="BhC-qC-LQP" id="kU2-4D-g7J"/>
<outlet property="oldStoreNameField" destination="4fu-eE-Cen" id="iL0-HX-rgW"/>
<outlet property="storeNameField" destination="Lua-1g-dWJ" id="VNt-On-SRd"/>
<outlet property="sureButton" destination="ohE-i9-kyM" id="QFF-1R-rzS"/>
<outlet property="titleLabel" destination="Xma-OD-U5k" id="kur-8y-wEk"/>
</connections>
<point key="canvasLocation" x="130.40000000000001" y="153.37331334332833"/>
</view>
</objects>
</document>

View File

@ -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

View File

@ -7,6 +7,7 @@
//
#import "remindCyclePic.h"
#import "IfishDeviceInfo.h"
#define CANCLE_BTN 100000100
#define SURE_BTN 100000120
@interface remindCyclePic()<UIPickerViewDataSource,UIPickerViewDelegate>
@ -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"]];
}
}

View File

@ -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;

View File

@ -1,9 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
@ -12,26 +15,26 @@
<rect key="frame" x="0.0" y="0.0" width="329" height="48"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="329" height="47"/>
<rect key="frame" x="0.0" y="0.0" width="329" height="47.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="换水提醒" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Mjj-aG-rUn">
<rect key="frame" x="18" y="15" width="93" height="18"/>
<rect key="frame" x="26" y="15" width="77" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="751" text="设置换水周期" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="B34-8H-MOY">
<rect key="frame" x="152" y="15" width="84" height="17"/>
<rect key="frame" x="144" y="15.5" width="84" height="17"/>
<constraints>
<constraint firstAttribute="width" constant="84" id="VGM-eZ-LlO"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.4549019608" green="0.4549019608" blue="0.4549019608" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="0.4549019608" green="0.4549019608" blue="0.4549019608" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hLN-Fh-Sqa">
<rect key="frame" x="256" y="7" width="60" height="33"/>
<rect key="frame" x="248" y="7.5" width="60" height="33"/>
<constraints>
<constraint firstAttribute="width" constant="60" id="Qvn-Gu-NCL"/>
<constraint firstAttribute="height" constant="33" id="htW-pi-0lf"/>
@ -52,8 +55,9 @@
<connections>
<outlet property="ChangeWaterSwitch" destination="hLN-Fh-Sqa" id="lmL-w1-THT"/>
<outlet property="huanshuiDaylabel" destination="B34-8H-MOY" id="kZD-uO-VMn"/>
<outlet property="titleLabel" destination="Mjj-aG-rUn" id="yhO-z2-3Pc"/>
</connections>
<point key="canvasLocation" x="300.5" y="312"/>
<point key="canvasLocation" x="480.80000000000001" y="280.65967016491754"/>
</tableViewCell>
</objects>
<resources>