diff --git a/.gitignore b/.gitignore index f8447b5..e19dcd0 100644 --- a/.gitignore +++ b/.gitignore @@ -28,7 +28,18 @@ xcuserdata *.hmap *.ipa -作者:kuazi -链接:https://www.jianshu.com/p/82e1d05baf1c -來源:简书 -著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。 \ No newline at end of file +.DS_Store + +# fastlane specific +fastlane/report.xml + +# deliver temporary files +fastlane/Preview.html + +# snapshot generated screenshots +fastlane/screenshots + +# scan temporary files +fastlane/test_output + +Ifish.app.dSYM.zip \ No newline at end of file diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..7a118b4 --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gem "fastlane" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..0504319 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,152 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.0) + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) + atomos (0.1.2) + babosa (1.0.2) + claide (1.0.2) + colored (1.2) + colored2 (3.1.2) + commander-fastlane (4.4.6) + highline (~> 1.7.2) + declarative (0.0.10) + declarative-option (0.1.0) + domain_name (0.5.20180417) + unf (>= 0.0.5, < 1.0.0) + dotenv (2.5.0) + emoji_regex (0.1.1) + excon (0.62.0) + faraday (0.15.2) + multipart-post (>= 1.2, < 3) + faraday-cookie_jar (0.0.6) + faraday (>= 0.7.4) + http-cookie (~> 1.0.0) + faraday_middleware (0.12.2) + faraday (>= 0.7.4, < 1.0) + fastimage (2.1.3) + fastlane (2.99.0) + CFPropertyList (>= 2.3, < 4.0.0) + addressable (>= 2.3, < 3.0.0) + babosa (>= 1.0.2, < 2.0.0) + bundler (>= 1.12.0, < 2.0.0) + colored + commander-fastlane (>= 4.4.6, < 5.0.0) + dotenv (>= 2.1.1, < 3.0.0) + emoji_regex (~> 0.1) + excon (>= 0.45.0, < 1.0.0) + faraday (~> 0.9) + faraday-cookie_jar (~> 0.0.6) + faraday_middleware (~> 0.9) + fastimage (>= 2.1.0, < 3.0.0) + gh_inspector (>= 1.1.2, < 2.0.0) + google-api-client (>= 0.21.2, < 0.22.0) + highline (>= 1.7.2, < 2.0.0) + json (< 3.0.0) + mini_magick (~> 4.5.1) + multi_json + multi_xml (~> 0.5) + multipart-post (~> 2.0.0) + plist (>= 3.1.0, < 4.0.0) + public_suffix (~> 2.0.0) + rubyzip (>= 1.2.1, < 2.0.0) + security (= 0.1.3) + simctl (~> 1.6.3) + slack-notifier (>= 2.0.0, < 3.0.0) + terminal-notifier (>= 1.6.2, < 2.0.0) + terminal-table (>= 1.4.5, < 2.0.0) + tty-screen (>= 0.6.3, < 1.0.0) + tty-spinner (>= 0.8.0, < 1.0.0) + word_wrap (~> 1.0.0) + xcodeproj (>= 1.5.7, < 2.0.0) + xcpretty (~> 0.2.8) + xcpretty-travis-formatter (>= 0.0.3) + gh_inspector (1.1.3) + google-api-client (0.21.2) + addressable (~> 2.5, >= 2.5.1) + googleauth (>= 0.5, < 0.7.0) + httpclient (>= 2.8.1, < 3.0) + mime-types (~> 3.0) + representable (~> 3.0) + retriable (>= 2.0, < 4.0) + googleauth (0.6.2) + faraday (~> 0.12) + jwt (>= 1.4, < 3.0) + logging (~> 2.0) + memoist (~> 0.12) + multi_json (~> 1.11) + os (~> 0.9) + signet (~> 0.7) + highline (1.7.10) + http-cookie (1.0.3) + domain_name (~> 0.5) + httpclient (2.8.3) + json (2.1.0) + jwt (2.1.0) + little-plugger (1.1.4) + logging (2.2.2) + little-plugger (~> 1.1) + multi_json (~> 1.10) + memoist (0.16.0) + mime-types (3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2016.0521) + mini_magick (4.5.1) + multi_json (1.13.1) + multi_xml (0.6.0) + multipart-post (2.0.0) + nanaimo (0.2.6) + naturally (2.2.0) + os (0.9.6) + plist (3.4.0) + public_suffix (2.0.5) + representable (3.0.4) + declarative (< 0.1.0) + declarative-option (< 0.2.0) + uber (< 0.2.0) + retriable (3.1.2) + rouge (2.0.7) + rubyzip (1.2.1) + security (0.1.3) + signet (0.8.1) + addressable (~> 2.3) + faraday (~> 0.9) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) + simctl (1.6.5) + CFPropertyList + naturally + slack-notifier (2.3.2) + terminal-notifier (1.8.0) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) + tty-cursor (0.5.0) + tty-screen (0.6.4) + tty-spinner (0.8.0) + tty-cursor (>= 0.5.0) + uber (0.1.0) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.5) + unicode-display_width (1.4.0) + word_wrap (1.0.0) + xcodeproj (1.5.9) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.2) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.2.5) + xcpretty (0.2.8) + rouge (~> 2.0.7) + xcpretty-travis-formatter (1.0.0) + xcpretty (~> 0.2, >= 0.0.7) + +PLATFORMS + ruby + +DEPENDENCIES + fastlane + +BUNDLED WITH + 1.14.6 diff --git a/Ifish.xcodeproj/project.pbxproj b/Ifish.xcodeproj/project.pbxproj index 94f15c6..da08204 100644 --- a/Ifish.xcodeproj/project.pbxproj +++ b/Ifish.xcodeproj/project.pbxproj @@ -2464,6 +2464,39 @@ 88F5EFF01D48D08100CC7CAF /* split.c in Sources */ = {isa = PBXBuildFile; fileRef = 88F5EF8E1D48D08100CC7CAF /* split.c */; }; 88F5EFF11D48D08100CC7CAF /* libzbar.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 88F5EFA81D48D08100CC7CAF /* libzbar.a */; }; 88F740C01ECC28E800876AED /* ShopAddGoodsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88F740BF1ECC28E800876AED /* ShopAddGoodsViewController.m */; }; + E51D7D4B208CD528001FF053 /* RuiMeiCHNameCustom.m in Sources */ = {isa = PBXBuildFile; fileRef = E51D7D4A208CD528001FF053 /* RuiMeiCHNameCustom.m */; }; + E51D7D4E208CD5C8001FF053 /* RuiMeiCHControl.m in Sources */ = {isa = PBXBuildFile; fileRef = E51D7D4D208CD5C8001FF053 /* RuiMeiCHControl.m */; }; + E51D7D51208CDB5B001FF053 /* RuiMeiSetViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E51D7D50208CDB5B001FF053 /* RuiMeiSetViewController.m */; }; + E51D7D55208CE08D001FF053 /* CustomModeSetCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E51D7D53208CE08D001FF053 /* CustomModeSetCell.m */; }; + E51D7D58208CE121001FF053 /* CustomModeSetCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E51D7D57208CE120001FF053 /* CustomModeSetCell.xib */; }; + E51D7D5B208CF4E7001FF053 /* RuiMeiInputViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E51D7D5A208CF4E7001FF053 /* RuiMeiInputViewController.m */; }; + E521222C21075C0D00BA24C5 /* tip.png in Resources */ = {isa = PBXBuildFile; fileRef = E521222B21075C0C00BA24C5 /* tip.png */; }; + E5212235210760A600BA24C5 /* SettingResetViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E5212233210760A600BA24C5 /* SettingResetViewController.m */; }; + E5212236210760A700BA24C5 /* SettingResetViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E5212234210760A600BA24C5 /* SettingResetViewController.xib */; }; + E52B400521042ED2003BBA3E /* ConnectHotspotTipViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E52B400321042ED2003BBA3E /* ConnectHotspotTipViewController.m */; }; + E52B400621042ED2003BBA3E /* ConnectHotspotTipViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E52B400421042ED2003BBA3E /* ConnectHotspotTipViewController.xib */; }; + E5317A1321188F170014AFDD /* ResetDeviceModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E5317A1221188F170014AFDD /* ResetDeviceModel.m */; }; + E5317A1621188F8A0014AFDD /* RestartDeviceModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E5317A1521188F8A0014AFDD /* RestartDeviceModel.m */; }; + E5317A19211896080014AFDD /* IFishUDPHelperBackMsgModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E5317A18211896080014AFDD /* IFishUDPHelperBackMsgModel.m */; }; + E547870B20728F390060C2C2 /* back_btn@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E547870A20728F380060C2C2 /* back_btn@2x.png */; }; + E547870F2073192E0060C2C2 /* introlImage_iphonex_1.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E547870C2073192D0060C2C2 /* introlImage_iphonex_1.jpg */; }; + E54787102073192E0060C2C2 /* introlImage_iphonex_2.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E547870D2073192D0060C2C2 /* introlImage_iphonex_2.jpg */; }; + E54787112073192E0060C2C2 /* introlImage_iphonex_3.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E547870E2073192E0060C2C2 /* introlImage_iphonex_3.jpg */; }; + E548F39720A557B7004CF1BC /* JiaReBang.png in Resources */ = {isa = PBXBuildFile; fileRef = E548F39620A557B5004CF1BC /* JiaReBang.png */; }; + E567026D21187E7C00E61993 /* ConnectHotspotModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E567026C21187E7C00E61993 /* ConnectHotspotModel.m */; }; + E56A746220FCDBFC000129C9 /* ConnectHotpotViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E56A746020FCDBFC000129C9 /* ConnectHotpotViewController.m */; }; + E56A746320FCDBFC000129C9 /* ConnectHotpotViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E56A746120FCDBFC000129C9 /* ConnectHotpotViewController.xib */; }; + E58C9980208189780004C42B /* back_btn_1@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E58C997F208189780004C42B /* back_btn_1@2x.png */; }; + E58C9984208195640004C42B /* RuiMeiViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E58C9983208195640004C42B /* RuiMeiViewController.m */; }; + E58C99872081A3BA0004C42B /* RuiMeiProtocolModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E58C99862081A3BA0004C42B /* RuiMeiProtocolModel.m */; }; + E58C998A2081A6930004C42B /* RuiMeiBackMsgUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = E58C99892081A6930004C42B /* RuiMeiBackMsgUtils.m */; }; + E5F1B03421183DCD00A879A1 /* setting-reset@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E5F1B03121183DCC00A879A1 /* setting-reset@2x.png */; }; + E5F1B03521183DCD00A879A1 /* setting-reset@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = E5F1B03221183DCD00A879A1 /* setting-reset@3x.png */; }; + E5F1B03621183DCD00A879A1 /* setting-reset.png in Resources */ = {isa = PBXBuildFile; fileRef = E5F1B03321183DCD00A879A1 /* setting-reset.png */; }; + E5F1B03A21183E9700A879A1 /* setting-restart@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = E5F1B03721183E9600A879A1 /* setting-restart@3x.png */; }; + E5F1B03B21183E9700A879A1 /* setting-restart.png in Resources */ = {isa = PBXBuildFile; fileRef = E5F1B03821183E9600A879A1 /* setting-restart.png */; }; + E5F1B03C21183E9700A879A1 /* setting-restart@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E5F1B03921183E9700A879A1 /* setting-restart@2x.png */; }; + E5F1B03F21184F9400A879A1 /* IFishHotpotUDPHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = E5F1B03D21184F9300A879A1 /* IFishHotpotUDPHelper.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -6241,6 +6274,56 @@ 88F5EFA81D48D08100CC7CAF /* libzbar.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libzbar.a; sourceTree = ""; }; 88F740BE1ECC28E800876AED /* ShopAddGoodsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShopAddGoodsViewController.h; sourceTree = ""; }; 88F740BF1ECC28E800876AED /* ShopAddGoodsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShopAddGoodsViewController.m; sourceTree = ""; }; + E51D7D49208CD528001FF053 /* RuiMeiCHNameCustom.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RuiMeiCHNameCustom.h; sourceTree = ""; }; + E51D7D4A208CD528001FF053 /* RuiMeiCHNameCustom.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RuiMeiCHNameCustom.m; sourceTree = ""; }; + E51D7D4C208CD5C8001FF053 /* RuiMeiCHControl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RuiMeiCHControl.h; sourceTree = ""; }; + E51D7D4D208CD5C8001FF053 /* RuiMeiCHControl.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RuiMeiCHControl.m; sourceTree = ""; }; + E51D7D4F208CDB5B001FF053 /* RuiMeiSetViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RuiMeiSetViewController.h; sourceTree = ""; }; + E51D7D50208CDB5B001FF053 /* RuiMeiSetViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RuiMeiSetViewController.m; sourceTree = ""; }; + E51D7D52208CE08D001FF053 /* CustomModeSetCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CustomModeSetCell.h; sourceTree = ""; }; + E51D7D53208CE08D001FF053 /* CustomModeSetCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CustomModeSetCell.m; sourceTree = ""; }; + E51D7D57208CE120001FF053 /* CustomModeSetCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CustomModeSetCell.xib; sourceTree = ""; }; + E51D7D59208CF4E7001FF053 /* RuiMeiInputViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RuiMeiInputViewController.h; sourceTree = ""; }; + E51D7D5A208CF4E7001FF053 /* RuiMeiInputViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RuiMeiInputViewController.m; sourceTree = ""; }; + E521222B21075C0C00BA24C5 /* tip.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tip.png; sourceTree = ""; }; + E5212232210760A600BA24C5 /* SettingResetViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SettingResetViewController.h; sourceTree = ""; }; + E5212233210760A600BA24C5 /* SettingResetViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SettingResetViewController.m; sourceTree = ""; }; + E5212234210760A600BA24C5 /* SettingResetViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SettingResetViewController.xib; sourceTree = ""; }; + E52B400221042ED2003BBA3E /* ConnectHotspotTipViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ConnectHotspotTipViewController.h; sourceTree = ""; }; + E52B400321042ED2003BBA3E /* ConnectHotspotTipViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ConnectHotspotTipViewController.m; sourceTree = ""; }; + E52B400421042ED2003BBA3E /* ConnectHotspotTipViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ConnectHotspotTipViewController.xib; sourceTree = ""; }; + E5317A1121188F170014AFDD /* ResetDeviceModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ResetDeviceModel.h; sourceTree = ""; }; + E5317A1221188F170014AFDD /* ResetDeviceModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ResetDeviceModel.m; sourceTree = ""; }; + E5317A1421188F8A0014AFDD /* RestartDeviceModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RestartDeviceModel.h; sourceTree = ""; }; + E5317A1521188F8A0014AFDD /* RestartDeviceModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RestartDeviceModel.m; sourceTree = ""; }; + E5317A17211896080014AFDD /* IFishUDPHelperBackMsgModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IFishUDPHelperBackMsgModel.h; sourceTree = ""; }; + E5317A18211896080014AFDD /* IFishUDPHelperBackMsgModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IFishUDPHelperBackMsgModel.m; sourceTree = ""; }; + E547870A20728F380060C2C2 /* back_btn@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "back_btn@2x.png"; sourceTree = ""; }; + E547870C2073192D0060C2C2 /* introlImage_iphonex_1.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = introlImage_iphonex_1.jpg; sourceTree = ""; }; + E547870D2073192D0060C2C2 /* introlImage_iphonex_2.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = introlImage_iphonex_2.jpg; sourceTree = ""; }; + E547870E2073192E0060C2C2 /* introlImage_iphonex_3.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = introlImage_iphonex_3.jpg; sourceTree = ""; }; + E548F39620A557B5004CF1BC /* JiaReBang.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = JiaReBang.png; sourceTree = ""; }; + E567026B21187E7C00E61993 /* ConnectHotspotModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ConnectHotspotModel.h; sourceTree = ""; }; + E567026C21187E7C00E61993 /* ConnectHotspotModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ConnectHotspotModel.m; sourceTree = ""; }; + E56A745F20FCDBFC000129C9 /* ConnectHotpotViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ConnectHotpotViewController.h; sourceTree = ""; }; + E56A746020FCDBFC000129C9 /* ConnectHotpotViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ConnectHotpotViewController.m; sourceTree = ""; }; + E56A746120FCDBFC000129C9 /* ConnectHotpotViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ConnectHotpotViewController.xib; sourceTree = ""; }; + E58C997F208189780004C42B /* back_btn_1@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "back_btn_1@2x.png"; sourceTree = ""; }; + E58C9982208195640004C42B /* RuiMeiViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RuiMeiViewController.h; sourceTree = ""; }; + E58C9983208195640004C42B /* RuiMeiViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RuiMeiViewController.m; sourceTree = ""; }; + E58C99852081A3BA0004C42B /* RuiMeiProtocolModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RuiMeiProtocolModel.h; sourceTree = ""; }; + E58C99862081A3BA0004C42B /* RuiMeiProtocolModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RuiMeiProtocolModel.m; sourceTree = ""; }; + E58C99882081A6930004C42B /* RuiMeiBackMsgUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RuiMeiBackMsgUtils.h; sourceTree = ""; }; + E58C99892081A6930004C42B /* RuiMeiBackMsgUtils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RuiMeiBackMsgUtils.m; sourceTree = ""; }; + E5C644C0206BBD7100C558D5 /* CommonMacros.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CommonMacros.h; sourceTree = ""; }; + E5F1B03121183DCC00A879A1 /* setting-reset@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "setting-reset@2x.png"; sourceTree = ""; }; + E5F1B03221183DCD00A879A1 /* setting-reset@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "setting-reset@3x.png"; sourceTree = ""; }; + E5F1B03321183DCD00A879A1 /* setting-reset.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "setting-reset.png"; sourceTree = ""; }; + E5F1B03721183E9600A879A1 /* setting-restart@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "setting-restart@3x.png"; sourceTree = ""; }; + E5F1B03821183E9600A879A1 /* setting-restart.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "setting-restart.png"; sourceTree = ""; }; + E5F1B03921183E9700A879A1 /* setting-restart@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "setting-restart@2x.png"; sourceTree = ""; }; + E5F1B03D21184F9300A879A1 /* IFishHotpotUDPHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IFishHotpotUDPHelper.m; sourceTree = ""; }; + E5F1B03E21184F9400A879A1 /* IFishHotpotUDPHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IFishHotpotUDPHelper.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -7996,6 +8079,12 @@ 882954921DBDA3A100E9DDD7 /* ifishWodeImgs */ = { isa = PBXGroup; children = ( + E5F1B03821183E9600A879A1 /* setting-restart.png */, + E5F1B03921183E9700A879A1 /* setting-restart@2x.png */, + E5F1B03721183E9600A879A1 /* setting-restart@3x.png */, + E5F1B03321183DCD00A879A1 /* setting-reset.png */, + E5F1B03121183DCC00A879A1 /* setting-reset@2x.png */, + E5F1B03221183DCD00A879A1 /* setting-reset@3x.png */, 889C14F01EA7397B00470F50 /* personal_iocn_set.png */, 889C14F11EA7397B00470F50 /* personal_iocn_set@2x.png */, 889C14F21EA7397B00470F50 /* personal_iocn_set@3x.png */, @@ -8064,6 +8153,9 @@ 882954B41DBDA3A100E9DDD7 /* introductionImage */ = { isa = PBXGroup; children = ( + E547870C2073192D0060C2C2 /* introlImage_iphonex_1.jpg */, + E547870D2073192D0060C2C2 /* introlImage_iphonex_2.jpg */, + E547870E2073192E0060C2C2 /* introlImage_iphonex_3.jpg */, 886D15841E6066D20085F7D6 /* introlImage_1.png */, 886D15851E6066D20085F7D6 /* introlImage_2.png */, 886D15861E6066D20085F7D6 /* introlImage_3.png */, @@ -8186,6 +8278,8 @@ 882955011DBDA3A100E9DDD7 /* NewLeftRightAddBack */ = { isa = PBXGroup; children = ( + E58C997F208189780004C42B /* back_btn_1@2x.png */, + E547870A20728F380060C2C2 /* back_btn@2x.png */, 885FBDFC1E4D5CD200E0D7D1 /* arrow_b.png */, 885FBDFD1E4D5CD200E0D7D1 /* arrow_l.png */, 885FBDFE1E4D5CD200E0D7D1 /* blackbar_white.png */, @@ -8219,7 +8313,6 @@ 8864843A1EE171D30046C3BD /* redact_line_pointgray@2x.png */, 8864843B1EE171D30046C3BD /* redact_line_pointgray@3x.png */, 8864843C1EE171D30046C3BD /* redact_line.png */, - 8864843D1EE171D30046C3BD /* redact_line@2x.png */, 8864843E1EE171D30046C3BD /* redact_line@3x.png */, 882955111DBDA3A100E9DDD7 /* bubble@1x.png */, 882955121DBDA3A100E9DDD7 /* bubble@2x.png */, @@ -8232,7 +8325,9 @@ 882955191DBDA3A100E9DDD7 /* DanBai_off.png */, 8829551A1DBDA3A100E9DDD7 /* DanBai_on.png */, 8829551B1DBDA3A100E9DDD7 /* graybtn_big.png */, + 8864843D1EE171D30046C3BD /* redact_line@2x.png */, 8829551C1DBDA3A100E9DDD7 /* guidengCell_back.png */, + E548F39620A557B5004CF1BC /* JiaReBang.png */, 8829551D1DBDA3A100E9DDD7 /* JiaReBang_off.png */, 8829551E1DBDA3A100E9DDD7 /* JiaReBang_on.png */, 8829551F1DBDA3A100E9DDD7 /* line.png */, @@ -8957,6 +9052,7 @@ 883E76621D48A5E50030E075 /* CenterontrolControllers */ = { isa = PBXGroup; children = ( + E58C9981208195350004C42B /* RuiMei */, 881B12411E1CCC5E004C074B /* JuNeng */, 889C25E31E1B7CD9004F745D /* RuSunTemp */, 883E76631D48A5E50030E075 /* FourControl */, @@ -9191,6 +9287,9 @@ 883E76E91D48A5E50030E075 /* pushSetControllrs */, 88D0F27B1EA6F53E00286022 /* IfishSetViewController.h */, 88D0F27C1EA6F53E00286022 /* IfishSetViewController.m */, + E5212232210760A600BA24C5 /* SettingResetViewController.h */, + E5212233210760A600BA24C5 /* SettingResetViewController.m */, + E5212234210760A600BA24C5 /* SettingResetViewController.xib */, ); path = mineControllers; sourceTree = ""; @@ -9623,8 +9722,25 @@ 883E781C1D48A5E50030E075 /* SecondConnectWifiController.xib */, 883E781D1D48A5E50030E075 /* SelectDeviceViewController.h */, 883E781E1D48A5E50030E075 /* SelectDeviceViewController.m */, + E5317A1421188F8A0014AFDD /* RestartDeviceModel.h */, + E5317A1521188F8A0014AFDD /* RestartDeviceModel.m */, + E5317A1121188F170014AFDD /* ResetDeviceModel.h */, + E5317A1221188F170014AFDD /* ResetDeviceModel.m */, 883E781F1D48A5E50030E075 /* SetViewController.h */, 883E78201D48A5E50030E075 /* SetViewController.m */, + E567026B21187E7C00E61993 /* ConnectHotspotModel.h */, + E567026C21187E7C00E61993 /* ConnectHotspotModel.m */, + E5317A17211896080014AFDD /* IFishUDPHelperBackMsgModel.h */, + E5317A18211896080014AFDD /* IFishUDPHelperBackMsgModel.m */, + E5F1B03E21184F9400A879A1 /* IFishHotpotUDPHelper.h */, + E5F1B03D21184F9300A879A1 /* IFishHotpotUDPHelper.m */, + E56A745F20FCDBFC000129C9 /* ConnectHotpotViewController.h */, + E56A746020FCDBFC000129C9 /* ConnectHotpotViewController.m */, + E56A746120FCDBFC000129C9 /* ConnectHotpotViewController.xib */, + E52B400221042ED2003BBA3E /* ConnectHotspotTipViewController.h */, + E52B400321042ED2003BBA3E /* ConnectHotspotTipViewController.m */, + E521222B21075C0C00BA24C5 /* tip.png */, + E52B400421042ED2003BBA3E /* ConnectHotspotTipViewController.xib */, ); path = leftcontrollers; sourceTree = ""; @@ -9956,6 +10072,9 @@ 883E799C1D48B0280030E075 /* TemperatureSetCell.h */, 883E799D1D48B0280030E075 /* TemperatureSetCell.m */, 883E799E1D48B0280030E075 /* TemperatureSetCell.xib */, + E51D7D52208CE08D001FF053 /* CustomModeSetCell.h */, + E51D7D53208CE08D001FF053 /* CustomModeSetCell.m */, + E51D7D57208CE120001FF053 /* CustomModeSetCell.xib */, ); path = setViewCell; sourceTree = ""; @@ -12556,6 +12675,7 @@ 8876A5851BB83447007A4B54 /* Ifish */ = { isa = PBXGroup; children = ( + E5C644BF206BBD5F00C558D5 /* Common */, 882953EA1DBDA3A000E9DDD7 /* ifishImgSouce */, 881B9F581D9CA98B001948AD /* Ifish.entitlements */, 88F5EEE81D48D04100CC7CAF /* libs */, @@ -13795,6 +13915,35 @@ path = zbar; sourceTree = ""; }; + E58C9981208195350004C42B /* RuiMei */ = { + isa = PBXGroup; + children = ( + E58C99852081A3BA0004C42B /* RuiMeiProtocolModel.h */, + E58C99862081A3BA0004C42B /* RuiMeiProtocolModel.m */, + E58C99882081A6930004C42B /* RuiMeiBackMsgUtils.h */, + E58C99892081A6930004C42B /* RuiMeiBackMsgUtils.m */, + E58C9982208195640004C42B /* RuiMeiViewController.h */, + E58C9983208195640004C42B /* RuiMeiViewController.m */, + E51D7D49208CD528001FF053 /* RuiMeiCHNameCustom.h */, + E51D7D4A208CD528001FF053 /* RuiMeiCHNameCustom.m */, + E51D7D4C208CD5C8001FF053 /* RuiMeiCHControl.h */, + E51D7D4D208CD5C8001FF053 /* RuiMeiCHControl.m */, + E51D7D4F208CDB5B001FF053 /* RuiMeiSetViewController.h */, + E51D7D50208CDB5B001FF053 /* RuiMeiSetViewController.m */, + E51D7D59208CF4E7001FF053 /* RuiMeiInputViewController.h */, + E51D7D5A208CF4E7001FF053 /* RuiMeiInputViewController.m */, + ); + path = RuiMei; + sourceTree = ""; + }; + E5C644BF206BBD5F00C558D5 /* Common */ = { + isa = PBXGroup; + children = ( + E5C644C0206BBD7100C558D5 /* CommonMacros.h */, + ); + path = Common; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -13864,7 +14013,7 @@ 8876A5821BB83447007A4B54 = { CreatedOnToolsVersion = 7.0; DevelopmentTeam = WFX8GD5HFX; - ProvisioningStyle = Manual; + ProvisioningStyle = Automatic; SystemCapabilities = { com.apple.BackgroundModes = { enabled = 1; @@ -14014,6 +14163,7 @@ 882956B61DBDA3A200E9DDD7 /* scan_left.png in Resources */, 8815D1E81E02662600BEA2DA /* FullPlay_Previous_down.png in Resources */, 88C1B1EE1DC9AF3700C2C99A /* home_iocnmydevice@2x.png in Resources */, + E547870B20728F390060C2C2 /* back_btn@2x.png in Resources */, 885FBE1D1E4D66C100E0D7D1 /* merchant_iocn_a_member@2x.png in Resources */, 8871C4421E6D223F000AA49F /* QianDaoBannerViewCell.xib in Resources */, 882955DA1DBDA3A100E9DDD7 /* blac@3x.png in Resources */, @@ -14043,6 +14193,7 @@ 8856B0F51DEE9FC7009D384A /* CameraBottomCollectionViewCell.xib in Resources */, 88C1B2201DCC5A1400C2C99A /* personal_iocn_switch.png in Resources */, 882956691DBDA3A200E9DDD7 /* minelook_buy.png in Resources */, + E5212236210760A700BA24C5 /* SettingResetViewController.xib in Resources */, 887492331E7A90D000CDA284 /* fishdoctor_iocn_default_fiftygold@2x.png in Resources */, 885979CE1E5293A1003D0E5C /* explore_iocn_optimization@2x.png in Resources */, 8871FADE1EBC58D70038E99A /* attestation_laststep_button@3x.png in Resources */, @@ -14069,6 +14220,7 @@ 8829560B1DBDA3A100E9DDD7 /* neves0014.png in Resources */, 887492431E7A90D000CDA284 /* fishdoctor_iocn_optimization@3x.png in Resources */, 889133221ECE99B900F52EBC /* recording_backdrop.png in Resources */, + E52B400621042ED2003BBA3E /* ConnectHotspotTipViewController.xib in Resources */, 88F23F2A1EA9D18700E4D298 /* live_botton_uncheck_like.png in Resources */, 88696FC61E9C81F2005D4AFB /* ShopMemberDetailViewInfoCell.xib in Resources */, 8829573B1DBDA3A300E9DDD7 /* swimmingfish0042.png in Resources */, @@ -14256,9 +14408,11 @@ 88F23F281EA9D18700E4D298 /* live_botton_like@2x.png in Resources */, 882956121DBDA3A100E9DDD7 /* neves0021.png in Resources */, 8871FB1E1EBC822B0038E99A /* select_camera.png in Resources */, + E547870F2073192E0060C2C2 /* introlImage_iphonex_1.jpg in Resources */, 882956621DBDA3A200E9DDD7 /* mineKanHu_bind.png in Resources */, 882957971DBDA3A400E9DDD7 /* xutobtn3_off@1x.png in Resources */, 887492401E7A90D000CDA284 /* fishdoctor_iocn_help@3x.png in Resources */, + E54787112073192E0060C2C2 /* introlImage_iphonex_3.jpg in Resources */, 887492341E7A90D000CDA284 /* fishdoctor_iocn_default_fiftygold@3x.png in Resources */, 8815D1E91E02662600BEA2DA /* FullPlay_Silence.png in Resources */, 883E79131D48A74F0030E075 /* lightSelect.png in Resources */, @@ -14294,6 +14448,7 @@ 883517F11E6664D200FCBE56 /* fishrank_crab@3x.png in Resources */, 8829574D1DBDA3A300E9DDD7 /* swimmingfish0060.png in Resources */, 882957771DBDA3A400E9DDD7 /* basion_logo.png in Resources */, + E54787102073192E0060C2C2 /* introlImage_iphonex_2.jpg in Resources */, 8874922C1E7A90D000CDA284 /* fishdoctor_iocn__fiftygold.png in Resources */, 8829566B1DBDA3A200E9DDD7 /* shop_certification_introduce.png in Resources */, 8815D1DD1E02662500BEA2DA /* FullPlay_Back_down.png in Resources */, @@ -14351,6 +14506,7 @@ 88F23F2F1EA9D18700E4D298 /* live_label_v@3x.png in Resources */, 882957511DBDA3A300E9DDD7 /* swimmingfish0064.png in Resources */, 887491E11E78E28100CDA284 /* gold_iocn@2x.png in Resources */, + E58C9980208189780004C42B /* back_btn_1@2x.png in Resources */, 88696FF61E9CBC2E005D4AFB /* home_iocn_hotsell.png in Resources */, 882956171DBDA3A100E9DDD7 /* neves0026.png in Resources */, 886512041E97966400BABDF1 /* task_shareIfishApp.png in Resources */, @@ -14430,6 +14586,7 @@ 883283971EAF4BF800A47157 /* explore_iocn_messages.png in Resources */, 8860D7901D6D7BE8001E544C /* KanHuWorkViewFirstCell.xib in Resources */, 88C1B1CC1DC99B0500C2C99A /* TabMineDeivceListViewCell.xib in Resources */, + E5F1B03421183DCD00A879A1 /* setting-reset@2x.png in Resources */, 882957681DBDA3A300E9DDD7 /* ifishmenu@1x.png in Resources */, 883283981EAF4BF800A47157 /* explore_iocn_messages@2x.png in Resources */, 88602A711E10BC3500F3DB5D /* NIMKitSettings.bundle in Resources */, @@ -14680,6 +14837,7 @@ 88742C2F1D63F9AB0074F1F8 /* CertifyListViewFirstCell.xib in Resources */, 883E783C1D48A5E50030E075 /* StoreViewController.xib in Resources */, 880708041DE812B30076F65A /* live_sharechat_iocn@2x.png in Resources */, + E51D7D58208CE121001FF053 /* CustomModeSetCell.xib in Resources */, 882956A61DBDA3A200E9DDD7 /* community_left@2x.png in Resources */, 883E79181D48A74F0030E075 /* scanscanBg.png in Resources */, 8871C4981E6D507B000AA49F /* signin_condition_await@3x.png in Resources */, @@ -14845,6 +15003,7 @@ 8829577B1DBDA3A400E9DDD7 /* set_cellBack.png in Resources */, 88591EED1D65B8B500A1316E /* ShopCertifyFailViewController.xib in Resources */, 8849EFC11EB883840096CAD7 /* enter_tablet@3x.png in Resources */, + E5F1B03521183DCD00A879A1 /* setting-reset@3x.png in Resources */, 8871C49F1E6D507B000AA49F /* signin_condition_gift_achieve.png in Resources */, 881F0F501D73DF4E0091507E /* BaoGaoViewFirstCell.xib in Resources */, 885979F91E542371003D0E5C /* IfishShopEdite2ViewCell.xib in Resources */, @@ -14876,6 +15035,7 @@ 886D15871E6066D20085F7D6 /* introlImage_1.png in Resources */, 882956271DBDA3A200E9DDD7 /* neves0042.png in Resources */, 882956331DBDA3A200E9DDD7 /* neves0054.png in Resources */, + E5F1B03A21183E9700A879A1 /* setting-restart@3x.png in Resources */, 88D337351DC71EB5006C0ADB /* linkingdevice_setting@2x.png in Resources */, 88C1B2161DCC5A1400C2C99A /* personal_iocn_feedback@3x.png in Resources */, 8860D7A71D6D9463001E544C /* shopEditViewImgCell.xib in Resources */, @@ -15007,12 +15167,14 @@ 882957331DBDA3A300E9DDD7 /* swimmingfish0034.png in Resources */, 8871C4A01E6D507B000AA49F /* signin_condition_gift_achieve@2x.png in Resources */, 882956FC1DBDA3A300E9DDD7 /* JiaReBang_on.png in Resources */, + E5F1B03C21183E9700A879A1 /* setting-restart@2x.png in Resources */, 88602F9C1E12002600F3DB5D /* NTESWhiteboardViewController.xib in Resources */, 885FBDD21E4C0CB400E0D7D1 /* explore_iocn_look@3x.png in Resources */, 880708021DE812040076F65A /* live_sharechat_iocn.png in Resources */, 88613F751E5C1E86008D2C69 /* P2PShareViewFeedMessageCell.xib in Resources */, 8829574E1DBDA3A300E9DDD7 /* swimmingfish0061.png in Resources */, 882957531DBDA3A300E9DDD7 /* swimmingfish0066.png in Resources */, + E56A746320FCDBFC000129C9 /* ConnectHotpotViewController.xib in Resources */, 883283991EAF4BF800A47157 /* explore_iocn_messages@3x.png in Resources */, 88602F2B1E12002500F3DB5D /* NTESTeamListViewController.xib in Resources */, 886FB1901E5A9A0500256332 /* explore_iocn_doctor@2x.png in Resources */, @@ -15028,6 +15190,7 @@ 882956D21DBDA3A300E9DDD7 /* ifish_qiehuan_device@2x.png in Resources */, 8829A5591EA78F56005A76CB /* ifish_loading_hold@2x.png in Resources */, 885FBE171E4D66C000E0D7D1 /* merchant_iocn_a_commodity@2x.png in Resources */, + E548F39720A557B7004CF1BC /* JiaReBang.png in Resources */, 8856B0E81DEC15F5009D384A /* home_popup_cancel@2x.png in Resources */, 883E78F41D48A5E50030E075 /* SecondConnectWifiController.xib in Resources */, 88602F921E12002600F3DB5D /* NTESFilePreViewController.xib in Resources */, @@ -15066,6 +15229,7 @@ 882956221DBDA3A100E9DDD7 /* neves0037.png in Resources */, 882956311DBDA3A200E9DDD7 /* neves0052.png in Resources */, 8814782C1E712A2700BFB79C /* task_shareCameraPicture@2x.png in Resources */, + E521222C21075C0D00BA24C5 /* tip.png in Resources */, 88C1B21B1DCC5A1400C2C99A /* personal_iocn_replace@2x.png in Resources */, 88602F541E12002600F3DB5D /* NTESContactViewController.xib in Resources */, 881478381E712E3A00BFB79C /* TaskKindViewCell.xib in Resources */, @@ -15090,6 +15254,7 @@ 885979E81E52EB11003D0E5C /* nurse_empty_picture@3x.png in Resources */, 885979D41E529F64003D0E5C /* GoNetShopViewCell.xib in Resources */, 886FB1A21E5A9D0A00256332 /* FishDocSection0ViewImgCell.xib in Resources */, + E5F1B03621183DCD00A879A1 /* setting-reset.png in Resources */, 88380DAE1EB1D96A00FC7C0D /* merchant_iocn_stock@2x.png in Resources */, 8829581A1DC04ED200E9DDD7 /* equipment_point.png in Resources */, 882956381DBDA3A200E9DDD7 /* neves0059.png in Resources */, @@ -15122,6 +15287,7 @@ 8867F5D11E656F9100AF021C /* rank_iocn_assist@3x.png in Resources */, 8832EABD1ED2834200D9195E /* shop_goods_edite.png in Resources */, 883E79B51D48B0280030E075 /* Box.png in Resources */, + E5F1B03B21183E9700A879A1 /* setting-restart.png in Resources */, 88597A071E5428A5003D0E5C /* IfishSHopEdite4ViewCell.xib in Resources */, 886484451EE171D30046C3BD /* redact_line_pointgray.png in Resources */, 8871FB041EBC63D30038E99A /* attestation_license@2x.png in Resources */, @@ -15221,7 +15387,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "#!/bin/sh\n#\n# Copyright 2016 Bugly, Tencent. All rights reserved.\n#\n# V1.4.0\n#\n# 2016.08.03\n#\n#\n#\n######################################################\n# 1. 脚本集成到Xcode工程的Target\n######################################################\n#\n# --- Copy the SCRIPT to the Run Script of Build Phases in the Xcode project ---\n#\n# #\nBUGLY_APP_ID=\"900013241\"\n# #\nBUGLY_APP_KEY=\"Uy1NpWpXAaXEud4E\"\n# #\nBUNDLE_IDENTIFIER=\"com.shyuying.Ifish8\"\n# #\nUPLOAD_DSYM_ONLY=1\n#\n# # 脚本默认配置的版本格式为CFBundleShortVersionString(CFBundleVersion), 如果你修改默认的版本格式, 请设置此变量, 如果不想修改, 请忽略此设置\n# CUSTOMIZED_APP_VERSION=\"\"\n#\n# # Debug模式编译是否上传,1=上传 0=不上传,默认不上传\n# UPLOAD_DEBUG_SYMBOLS=0\n#\n# # 模拟器编译是否上传,1=上传 0=不上传,默认不上传\n# UPLOAD_SIMULATOR_SYMBOLS=0\n#\n# #只有Archive操作时上传, 1=支持Archive上传 0=所有Release模式编译都上传\n# UPLOAD_ARCHIVE_ONLY=0\n#\n# #\n# source dSYMUpload.sh\n#\n# --- END OF SCRIPT ---\n#\n#\n#\n#\n#######################################################\n# 2. 脚本根据输入参数处理\n#######################################################\n#\n# #命令行下输入应用基本信息, .dSYM文件的父目录路径, 输出文件目录即可\n#\n# sh dSYMUpload.sh \n#\n# #\n#\n# #注意:\n# # 1. dSYMUpload.sh会调用buglySymboliOS.jar进行.dSYM解析,所以依赖Java运行时环境\n# # 2. dSYMUpload.sh和buglySymboliOS.jar的文件路径需一致\n#\n#\n\n#\n# --- CONTENT OF SCRIPT ---\n#\n\n# Bugly服务域名\nBUGLY_DSYM_UPLOAD_DOMAIN=\"api.bugly.qq.com\"\n\n# 注意jar工具的路径跟dSYMUpload.sh脚本路径一致, 请务必保证jar路径的正确性\nBUGLY_SYMBOL_JAR_PATH=\"dsymtool/buglySymboliOS.jar\"\n# 查找添加到系统目录的jar工具\nif [ ! -f \"${BUGLY_SYMBOL_JAR_PATH}\" ]; then\nBUGLY_SYMBOL_JAR_PATH=\"$HOME/bin/buglySymboliOS.jar\"\nfi\n\n# 打印错误信息\nfunction exitWithMessage(){\n echo \"--------------------------------\"\n echo \"${1}\"\n echo \"--------------------------------\"\n exit ${2}\n}\n\n# 上传bSYMBOL文件\nfunction dSYMUpload() {\n P_APP_ID=\"$1\"\n P_APP_KEY=\"$2\"\n P_APP_BUNDLE_ID=\"$3\"\n P_APP_VERSION=\"$4\"\n P_BSYMBOL_ZIP_FILE=\"$5\"\n \n #\n P_BSYMBOL_ZIP_FILE_NAME=${P_BSYMBOL_ZIP_FILE##*/}\n P_BSYMBOL_ZIP_FILE_NAME=${P_BSYMBOL_ZIP_FILE_NAME//&/_}\n P_BSYMBOL_ZIP_FILE_NAME=\"${P_BSYMBOL_ZIP_FILE_NAME// /_}\"\n \n DSYM_UPLOAD_URL=\"https://${BUGLY_DSYM_UPLOAD_DOMAIN}/openapi/file/upload/symbol?app_id=${P_APP_ID}&app_key=${P_APP_KEY}\"\n echo \"dSYM upload url: ${DSYM_UPLOAD_URL}\"\n \n echo \"-----------------------------\"\n STATUS=$(/usr/bin/curl -k \"${DSYM_UPLOAD_URL}\" --form \"api_version=1\" --form \"app_id=${P_APP_ID}\" --form \"app_key=${P_APP_KEY}\" --form \"symbolType=2\" --form \"bundleId=${BUNDLE_IDENTIFIER}\" --form \"productVersion=${BUGLY_APP_VERSION}\" --form \"fileName=${P_BSYMBOL_ZIP_FILE_NAME}\" --form \"file=@${P_BSYMBOL_ZIP_FILE}\" --verbose)\n echo \"-----------------------------\"\n \n UPLOAD_RESULT=\"FAILTURE\"\n echo \"Bugly server response: ${STATUS}\"\n if [ ! \"${STATUS}\" ]; then\n echo \"Error: Failed to upload the zip archive file.\"\n elif [[ \"${STATUS}\" == *\"{\\\"reponseCode\\\":\\\"0\\\"}\"* ]]; then\n echo \"Success to upload the dSYM for the app [${BUNDLE_IDENTIFIER} ${BUGLY_APP_VERSION}]\"\n UPLOAD_RESULT=\"SUCCESS\"\n else\n echo \"Error: Failed to upload the zip archive file to Bugly.\"\n fi\n \n #Remove temp dSYM archive\n #echo \"Remove temporary zip archive: ${DSYM_ZIP_FPATH}\"\n #/bin/rm -f \"${DSYM_ZIP_FPATH}\"\n \n if [ \"$?\" -ne 0 ]; then\n exitWithMessage \"Error: Failed to remove temporary zip archive.\" 0\n fi\n \n echo \"--------------------------------\"\n echo \"${UPLOAD_RESULT} - dSYM upload complete.\"\n \n if [[ \"${UPLOAD_RESULT}\" == \"FAILTURE\" ]]; then\n echo \"--------------------------------\"\n echo \"Failed to upload the dSYM\"\n echo \"Please check the script and try it again.\"\n fi\n }\n \n # .dSYM解析为bSYMBOL文件\n function dSYMParse() {\n DSYM_FILE=\"$1\"\n DSYM_SYMBOL_FILE=\"$2\"\n \n echo \"--------------------------------\"\n echo \"Extract symbol info from .dSYM file. to ${DSYM_SYMBOL_FILE}\"\n (/usr/bin/java -Xms512m -Xmx1024m -Dfile.encoding=UTF8 -jar \"${BUGLY_SYMBOL_JAR_PATH}\" -i \"${DSYM_FILE}\" -o \"${DSYM_SYMBOL_FILE}\" ) || exitWithMessage \"Error: Failed to extract symbols.\" 1\n echo \"--------------------------------\"\n \n }\n \n # 执行\n function run() {\n \n CONFIG_BUGLY_APP_ID=\"$1\"\n CONFIG_BUGLY_APP_KEY=\"$2\"\n \n CONFIG_BUGLY_APP_BUNDLE_IDENTIFIER=\"$3\"\n CONFIG_BUGLY_APP_VERSION=\"$4\"\n CONFIG_DSYM_SOURCE_DIR=\"$5\"\n CONFIG_DSYM_DEST_DIR=\"$6\"\n CONFIG_UPLOAD_DSYM_ONLY=\"$7\"\n \n # 检查必须参数是否设置\n if [ ! \"${CONFIG_BUGLY_APP_ID}\" ]; then\n exitWithMessage \"Error: Bugly App ID not defined. Please set 'BUGLY_APP_ID' \" 0\n fi\n \n if [[ \"${CONFIG_BUGLY_APP_ID}\" == *\"App ID\"* ]]; then\n exitWithMessage \"Error: Bugly App ID not defined.\" 0\n fi\n \n if [ ! \"${CONFIG_BUGLY_APP_KEY}\" ]; then\n exitWithMessage \"Error: Bugly App Key not defined.\" 0\n fi\n \n if [ ! \"${CONFIG_BUGLY_APP_BUNDLE_IDENTIFIER}\" ]; then\n exitWithMessage \"Error: Bundle Identifier not defined.\" 0\n fi\n \n if [ ! \"${CONFIG_BUGLY_APP_VERSION}\" ]; then\n exitWithMessage \"Error: App Version not defined.\" 0\n fi\n \n if [ ! -e \"${CONFIG_DSYM_SOURCE_DIR}\" ]; then\n exitWithMessage \"Error: Invalid dir ${CONFIG_DSYM_SOURCE_DIR}\" 0\n fi\n \n if [ ! \"${CONFIG_DSYM_DEST_DIR}\" ]; then\n exitWithMessage \"Error: Invalid dir ${CONFIG_DSYM_DEST_DIR}\" 0\n fi\n \n if [ ! -e \"${CONFIG_DSYM_DEST_DIR}\" ]; then\n mkdir ${CONFIG_DSYM_DEST_DIR}\n fi\n \n DSYM_FOLDER=\"${CONFIG_DSYM_SOURCE_DIR}\"\n IFS=$'\\n'\n \n echo \"Scaning dSYM FOLDER: ${DSYM_FOLDER} ...\"\n RET=\"F\"\n \n #\n for dsymFile in $(find \"$DSYM_FOLDER\" -name '*.dSYM'); do\n RET=\"T\"\n echo \"Found dSYM file: $dsymFile\"\n \n DSYM_FILE_NAME=${dsymFile##*/}\n DSYM_SYMBOL_ZIP_FILE_NAME=\"${DSYM_FILE_NAME}.zip\"\n DSYM_SYMBOL_ZIP_FILE_NAME=\"${DSYM_SYMBOL_ZIP_FILE_NAME// /_}\"\n DSYM_SYMBOL_ZIP_FILE=${CONFIG_DSYM_DEST_DIR}/${DSYM_SYMBOL_ZIP_FILE_NAME}\n \n if [ $CONFIG_UPLOAD_DSYM_ONLY -eq 1 ]; then\n if [ -e $DSYM_SYMBOL_ZIP_FILE ]; then\n rm -f $DSYM_SYMBOL_ZIP_FILE\n fi\n # 如果只上传dSYM,直接压缩dSYM目录\n zip -r -j $DSYM_SYMBOL_ZIP_FILE $dsymFile -x *.plist\n else\n # 使用符号表工具来生成Symbol文件\n dSYMParse $dsymFile $DSYM_SYMBOL_ZIP_FILE\n fi\n \n # 上传\n dSYMUpload $CONFIG_BUGLY_APP_ID $CONFIG_BUGLY_APP_KEY $CONFIG_BUGLY_APP_BUNDLE_IDENTIFIER $CONFIG_BUGLY_APP_VERSION $DSYM_SYMBOL_ZIP_FILE\n done\n \n if [ $RET = \"F\" ]; then\n exitWithMessage \"No .dSYM found in ${DSYM_FOLDER}\" 0\n fi\n }\n \n # 在Xcode工程中执行\n function runInXcode(){\n echo \"Uploading dSYM to Bugly in Xcode ...\"\n \n echo \"Info.Plist : ${INFOPLIST_FILE}\"\n \n BUNDLE_VERSION=$(/usr/libexec/PlistBuddy -c 'Print CFBundleVersion' \"${INFOPLIST_FILE}\")\n BUNDLE_SHORT_VERSION=$(/usr/libexec/PlistBuddy -c 'Print CFBundleShortVersionString' \"${INFOPLIST_FILE}\")\n \n # 组装Bugly默认识别的版本信息(格式为CFBundleShortVersionString(CFBundleVersion), 例如: 1.0(1))\n if [ ! \"${CUSTOMIZED_APP_VERSION}\" ]; then\n BUGLY_APP_VERSION=\"${BUNDLE_SHORT_VERSION}(${BUNDLE_VERSION})\"\n else\n BUGLY_APP_VERSION=\"${CUSTOMIZED_APP_VERSION}\"\n fi\n \n echo \"--------------------------------\"\n echo \"Prepare application information.\"\n echo \"--------------------------------\"\n \n echo \"Product Name: ${PRODUCT_NAME}\"\n echo \"Bundle Identifier: ${BUNDLE_IDENTIFIER}\"\n echo \"Version: ${BUNDLE_SHORT_VERSION}\"\n echo \"Build: ${BUNDLE_VERSION}\"\n \n echo \"Bugly App ID: ${BUGLY_APP_ID}\"\n echo \"Bugly App key: ${BUGLY_APP_KEY}\"\n echo \"Bugly App Version: ${BUGLY_APP_VERSION}\"\n \n echo \"--------------------------------\"\n echo \"Check the arguments ...\"\n \n ##检查模拟器编译是否允许上传符号\n if [ \"$EFFECTIVE_PLATFORM_NAME\" == \"-iphonesimulator\" ]; then\n if [ $UPLOAD_SIMULATOR_SYMBOLS -eq 0 ]; then\n exitWithMessage \"Warning: Build for simulator and skipping to upload. \\nYou can modify 'UPLOAD_SIMULATOR_SYMBOLS' to 1 in the script.\" 0\n fi\n fi\n \n ##检查是否是Release模式编译\n if [ \"${CONFIGURATION=}\" == \"Debug\" ]; then\n if [ $UPLOAD_DEBUG_SYMBOLS -eq 0 ]; then\n exitWithMessage \"Warning: Build for debug mode and skipping to upload. \\nYou can modify 'UPLOAD_DEBUG_SYMBOLS' to 1 in the script.\" 0\n fi\n fi\n \n ##检查是否Archive操作\n if [ $UPLOAD_ARCHIVE_ONLY -eq 1 ]; then\n if [[ \"$TARGET_BUILD_DIR\" == *\"/Archive\"* ]]; then\n echo \"Archive the package\"\n else\n exitWithMessage \"Warning: Build for NOT Archive mode and skipping to upload. \\nYou can modify 'UPLOAD_ARCHIVE_ONLY' to 0 in the script.\" 0\n fi\n fi\n \n #\n run ${BUGLY_APP_ID} ${BUGLY_APP_KEY} ${BUNDLE_IDENTIFIER} ${BUGLY_APP_VERSION} ${DWARF_DSYM_FOLDER_PATH} ${BUILD_DIR}/BuglySymbolTemp ${UPLOAD_DSYM_ONLY}\n }\n \n # 根据Xcode的环境变量判断是否处于Xcode环境\n INFO_PLIST_FILE=\"${INFOPLIST_FILE}\"\n \n BuildInXcode=\"F\"\n if [ -f \"${INFO_PLIST_FILE}\" ]; then\n BuildInXcode=\"T\"\n fi\n \n if [ $BuildInXcode = \"T\" ]; then\n runInXcode\n else\n echo \"\\nUsage: dSYMUpload.sh [upload_dsym_only]\\n\"\n # 你可以在此处直接设置BuglyAppID和BuglyAppKey,排除不常变参数的输入\n BUGLY_APP_ID=\"$1\"\n BUGLY_APP_KEY=\"$2\"\n BUNDLE_IDENTIFIER=\"$3\"\n BUGLY_APP_VERSION=\"$4\"\n DWARF_DSYM_FOLDER_PATH=\"$5\"\n SYMBOL_OUTPUT_PATH=\"$6\"\n UPLOAD_DSYM_ONLY=$7\n run ${BUGLY_APP_ID} ${BUGLY_APP_KEY} ${BUNDLE_IDENTIFIER} ${BUGLY_APP_VERSION} ${DWARF_DSYM_FOLDER_PATH} ${SYMBOL_OUTPUT_PATH} ${UPLOAD_DSYM_ONLY}\n fi"; + shellScript = "#!/bin/sh\n#\n# Copyright 2016 Bugly, Tencent. All rights reserved.\n#\n# V1.4.0\n#\n# 2016.08.03\n#\n#\n#\n######################################################\n# 1. 脚本集成到Xcode工程的Target\n######################################################\n#\n# --- Copy the SCRIPT to the Run Script of Build Phases in the Xcode project ---\n#\n# #\nBUGLY_APP_ID=\"16d2b238e3\"\n# #\nBUGLY_APP_KEY=\"2e8aa58d-e362-4aea-aaf9-d91b2732c63d\"\n# #\nBUNDLE_IDENTIFIER=\"com.shyuying.Ifish8\"\n# #\nUPLOAD_DSYM_ONLY=1\n#\n# # 脚本默认配置的版本格式为CFBundleShortVersionString(CFBundleVersion), 如果你修改默认的版本格式, 请设置此变量, 如果不想修改, 请忽略此设置\n# CUSTOMIZED_APP_VERSION=\"\"\n#\n# # Debug模式编译是否上传,1=上传 0=不上传,默认不上传\n# UPLOAD_DEBUG_SYMBOLS=0\n#\n# # 模拟器编译是否上传,1=上传 0=不上传,默认不上传\n# UPLOAD_SIMULATOR_SYMBOLS=0\n#\n# #只有Archive操作时上传, 1=支持Archive上传 0=所有Release模式编译都上传\n# UPLOAD_ARCHIVE_ONLY=0\n#\n# #\n# source dSYMUpload.sh\n#\n# --- END OF SCRIPT ---\n#\n#\n#\n#\n#######################################################\n# 2. 脚本根据输入参数处理\n#######################################################\n#\n# #命令行下输入应用基本信息, .dSYM文件的父目录路径, 输出文件目录即可\n#\n# sh dSYMUpload.sh \n#\n# #\n#\n# #注意:\n# # 1. dSYMUpload.sh会调用buglySymboliOS.jar进行.dSYM解析,所以依赖Java运行时环境\n# # 2. dSYMUpload.sh和buglySymboliOS.jar的文件路径需一致\n#\n#\n\n#\n# --- CONTENT OF SCRIPT ---\n#\n\n# Bugly服务域名\nBUGLY_DSYM_UPLOAD_DOMAIN=\"api.bugly.qq.com\"\n\n# 注意jar工具的路径跟dSYMUpload.sh脚本路径一致, 请务必保证jar路径的正确性\nBUGLY_SYMBOL_JAR_PATH=\"dsymtool/buglySymboliOS.jar\"\n# 查找添加到系统目录的jar工具\nif [ ! -f \"${BUGLY_SYMBOL_JAR_PATH}\" ]; then\nBUGLY_SYMBOL_JAR_PATH=\"$HOME/bin/buglySymboliOS.jar\"\nfi\n\n# 打印错误信息\nfunction exitWithMessage(){\n echo \"--------------------------------\"\n echo \"${1}\"\n echo \"--------------------------------\"\n exit ${2}\n}\n\n# 上传bSYMBOL文件\nfunction dSYMUpload() {\n P_APP_ID=\"$1\"\n P_APP_KEY=\"$2\"\n P_APP_BUNDLE_ID=\"$3\"\n P_APP_VERSION=\"$4\"\n P_BSYMBOL_ZIP_FILE=\"$5\"\n \n #\n P_BSYMBOL_ZIP_FILE_NAME=${P_BSYMBOL_ZIP_FILE##*/}\n P_BSYMBOL_ZIP_FILE_NAME=${P_BSYMBOL_ZIP_FILE_NAME//&/_}\n P_BSYMBOL_ZIP_FILE_NAME=\"${P_BSYMBOL_ZIP_FILE_NAME// /_}\"\n \n DSYM_UPLOAD_URL=\"https://${BUGLY_DSYM_UPLOAD_DOMAIN}/openapi/file/upload/symbol?app_id=${P_APP_ID}&app_key=${P_APP_KEY}\"\n echo \"dSYM upload url: ${DSYM_UPLOAD_URL}\"\n \n echo \"-----------------------------\"\n STATUS=$(/usr/bin/curl -k \"${DSYM_UPLOAD_URL}\" --form \"api_version=1\" --form \"app_id=${P_APP_ID}\" --form \"app_key=${P_APP_KEY}\" --form \"symbolType=2\" --form \"bundleId=${BUNDLE_IDENTIFIER}\" --form \"productVersion=${BUGLY_APP_VERSION}\" --form \"fileName=${P_BSYMBOL_ZIP_FILE_NAME}\" --form \"file=@${P_BSYMBOL_ZIP_FILE}\" --verbose)\n echo \"-----------------------------\"\n \n UPLOAD_RESULT=\"FAILTURE\"\n echo \"Bugly server response: ${STATUS}\"\n if [ ! \"${STATUS}\" ]; then\n echo \"Error: Failed to upload the zip archive file.\"\n elif [[ \"${STATUS}\" == *\"{\\\"reponseCode\\\":\\\"0\\\"}\"* ]]; then\n echo \"Success to upload the dSYM for the app [${BUNDLE_IDENTIFIER} ${BUGLY_APP_VERSION}]\"\n UPLOAD_RESULT=\"SUCCESS\"\n else\n echo \"Error: Failed to upload the zip archive file to Bugly.\"\n fi\n \n #Remove temp dSYM archive\n #echo \"Remove temporary zip archive: ${DSYM_ZIP_FPATH}\"\n #/bin/rm -f \"${DSYM_ZIP_FPATH}\"\n \n if [ \"$?\" -ne 0 ]; then\n exitWithMessage \"Error: Failed to remove temporary zip archive.\" 0\n fi\n \n echo \"--------------------------------\"\n echo \"${UPLOAD_RESULT} - dSYM upload complete.\"\n \n if [[ \"${UPLOAD_RESULT}\" == \"FAILTURE\" ]]; then\n echo \"--------------------------------\"\n echo \"Failed to upload the dSYM\"\n echo \"Please check the script and try it again.\"\n fi\n }\n \n # .dSYM解析为bSYMBOL文件\n function dSYMParse() {\n DSYM_FILE=\"$1\"\n DSYM_SYMBOL_FILE=\"$2\"\n \n echo \"--------------------------------\"\n echo \"Extract symbol info from .dSYM file. to ${DSYM_SYMBOL_FILE}\"\n (/usr/bin/java -Xms512m -Xmx1024m -Dfile.encoding=UTF8 -jar \"${BUGLY_SYMBOL_JAR_PATH}\" -i \"${DSYM_FILE}\" -o \"${DSYM_SYMBOL_FILE}\" ) || exitWithMessage \"Error: Failed to extract symbols.\" 1\n echo \"--------------------------------\"\n \n }\n \n # 执行\n function run() {\n \n CONFIG_BUGLY_APP_ID=\"$1\"\n CONFIG_BUGLY_APP_KEY=\"$2\"\n \n CONFIG_BUGLY_APP_BUNDLE_IDENTIFIER=\"$3\"\n CONFIG_BUGLY_APP_VERSION=\"$4\"\n CONFIG_DSYM_SOURCE_DIR=\"$5\"\n CONFIG_DSYM_DEST_DIR=\"$6\"\n CONFIG_UPLOAD_DSYM_ONLY=\"$7\"\n \n # 检查必须参数是否设置\n if [ ! \"${CONFIG_BUGLY_APP_ID}\" ]; then\n exitWithMessage \"Error: Bugly App ID not defined. Please set 'BUGLY_APP_ID' \" 0\n fi\n \n if [[ \"${CONFIG_BUGLY_APP_ID}\" == *\"App ID\"* ]]; then\n exitWithMessage \"Error: Bugly App ID not defined.\" 0\n fi\n \n if [ ! \"${CONFIG_BUGLY_APP_KEY}\" ]; then\n exitWithMessage \"Error: Bugly App Key not defined.\" 0\n fi\n \n if [ ! \"${CONFIG_BUGLY_APP_BUNDLE_IDENTIFIER}\" ]; then\n exitWithMessage \"Error: Bundle Identifier not defined.\" 0\n fi\n \n if [ ! \"${CONFIG_BUGLY_APP_VERSION}\" ]; then\n exitWithMessage \"Error: App Version not defined.\" 0\n fi\n \n if [ ! -e \"${CONFIG_DSYM_SOURCE_DIR}\" ]; then\n exitWithMessage \"Error: Invalid dir ${CONFIG_DSYM_SOURCE_DIR}\" 0\n fi\n \n if [ ! \"${CONFIG_DSYM_DEST_DIR}\" ]; then\n exitWithMessage \"Error: Invalid dir ${CONFIG_DSYM_DEST_DIR}\" 0\n fi\n \n if [ ! -e \"${CONFIG_DSYM_DEST_DIR}\" ]; then\n mkdir ${CONFIG_DSYM_DEST_DIR}\n fi\n \n DSYM_FOLDER=\"${CONFIG_DSYM_SOURCE_DIR}\"\n IFS=$'\\n'\n \n echo \"Scaning dSYM FOLDER: ${DSYM_FOLDER} ...\"\n RET=\"F\"\n \n #\n for dsymFile in $(find \"$DSYM_FOLDER\" -name '*.dSYM'); do\n RET=\"T\"\n echo \"Found dSYM file: $dsymFile\"\n \n DSYM_FILE_NAME=${dsymFile##*/}\n DSYM_SYMBOL_ZIP_FILE_NAME=\"${DSYM_FILE_NAME}.zip\"\n DSYM_SYMBOL_ZIP_FILE_NAME=\"${DSYM_SYMBOL_ZIP_FILE_NAME// /_}\"\n DSYM_SYMBOL_ZIP_FILE=${CONFIG_DSYM_DEST_DIR}/${DSYM_SYMBOL_ZIP_FILE_NAME}\n \n if [ $CONFIG_UPLOAD_DSYM_ONLY -eq 1 ]; then\n if [ -e $DSYM_SYMBOL_ZIP_FILE ]; then\n rm -f $DSYM_SYMBOL_ZIP_FILE\n fi\n # 如果只上传dSYM,直接压缩dSYM目录\n zip -r -j $DSYM_SYMBOL_ZIP_FILE $dsymFile -x *.plist\n else\n # 使用符号表工具来生成Symbol文件\n dSYMParse $dsymFile $DSYM_SYMBOL_ZIP_FILE\n fi\n \n # 上传\n dSYMUpload $CONFIG_BUGLY_APP_ID $CONFIG_BUGLY_APP_KEY $CONFIG_BUGLY_APP_BUNDLE_IDENTIFIER $CONFIG_BUGLY_APP_VERSION $DSYM_SYMBOL_ZIP_FILE\n done\n \n if [ $RET = \"F\" ]; then\n exitWithMessage \"No .dSYM found in ${DSYM_FOLDER}\" 0\n fi\n }\n \n # 在Xcode工程中执行\n function runInXcode(){\n echo \"Uploading dSYM to Bugly in Xcode ...\"\n \n echo \"Info.Plist : ${INFOPLIST_FILE}\"\n \n BUNDLE_VERSION=$(/usr/libexec/PlistBuddy -c 'Print CFBundleVersion' \"${INFOPLIST_FILE}\")\n BUNDLE_SHORT_VERSION=$(/usr/libexec/PlistBuddy -c 'Print CFBundleShortVersionString' \"${INFOPLIST_FILE}\")\n \n # 组装Bugly默认识别的版本信息(格式为CFBundleShortVersionString(CFBundleVersion), 例如: 1.0(1))\n if [ ! \"${CUSTOMIZED_APP_VERSION}\" ]; then\n BUGLY_APP_VERSION=\"${BUNDLE_SHORT_VERSION}(${BUNDLE_VERSION})\"\n else\n BUGLY_APP_VERSION=\"${CUSTOMIZED_APP_VERSION}\"\n fi\n \n echo \"--------------------------------\"\n echo \"Prepare application information.\"\n echo \"--------------------------------\"\n \n echo \"Product Name: ${PRODUCT_NAME}\"\n echo \"Bundle Identifier: ${BUNDLE_IDENTIFIER}\"\n echo \"Version: ${BUNDLE_SHORT_VERSION}\"\n echo \"Build: ${BUNDLE_VERSION}\"\n \n echo \"Bugly App ID: ${BUGLY_APP_ID}\"\n echo \"Bugly App key: ${BUGLY_APP_KEY}\"\n echo \"Bugly App Version: ${BUGLY_APP_VERSION}\"\n \n echo \"--------------------------------\"\n echo \"Check the arguments ...\"\n \n ##检查模拟器编译是否允许上传符号\n if [ \"$EFFECTIVE_PLATFORM_NAME\" == \"-iphonesimulator\" ]; then\n if [ $UPLOAD_SIMULATOR_SYMBOLS -eq 0 ]; then\n exitWithMessage \"Warning: Build for simulator and skipping to upload. \\nYou can modify 'UPLOAD_SIMULATOR_SYMBOLS' to 1 in the script.\" 0\n fi\n fi\n \n ##检查是否是Release模式编译\n if [ \"${CONFIGURATION=}\" == \"Debug\" ]; then\n if [ $UPLOAD_DEBUG_SYMBOLS -eq 0 ]; then\n exitWithMessage \"Warning: Build for debug mode and skipping to upload. \\nYou can modify 'UPLOAD_DEBUG_SYMBOLS' to 1 in the script.\" 0\n fi\n fi\n \n ##检查是否Archive操作\n if [ $UPLOAD_ARCHIVE_ONLY -eq 1 ]; then\n if [[ \"$TARGET_BUILD_DIR\" == *\"/Archive\"* ]]; then\n echo \"Archive the package\"\n else\n exitWithMessage \"Warning: Build for NOT Archive mode and skipping to upload. \\nYou can modify 'UPLOAD_ARCHIVE_ONLY' to 0 in the script.\" 0\n fi\n fi\n \n #\n run ${BUGLY_APP_ID} ${BUGLY_APP_KEY} ${BUNDLE_IDENTIFIER} ${BUGLY_APP_VERSION} ${DWARF_DSYM_FOLDER_PATH} ${BUILD_DIR}/BuglySymbolTemp ${UPLOAD_DSYM_ONLY}\n }\n \n # 根据Xcode的环境变量判断是否处于Xcode环境\n INFO_PLIST_FILE=\"${INFOPLIST_FILE}\"\n \n BuildInXcode=\"F\"\n if [ -f \"${INFO_PLIST_FILE}\" ]; then\n BuildInXcode=\"T\"\n fi\n \n if [ $BuildInXcode = \"T\" ]; then\n runInXcode\n else\n echo \"\\nUsage: dSYMUpload.sh [upload_dsym_only]\\n\"\n # 你可以在此处直接设置BuglyAppID和BuglyAppKey,排除不常变参数的输入\n BUGLY_APP_ID=\"$1\"\n BUGLY_APP_KEY=\"$2\"\n BUNDLE_IDENTIFIER=\"$3\"\n BUGLY_APP_VERSION=\"$4\"\n DWARF_DSYM_FOLDER_PATH=\"$5\"\n SYMBOL_OUTPUT_PATH=\"$6\"\n UPLOAD_DSYM_ONLY=$7\n run ${BUGLY_APP_ID} ${BUGLY_APP_KEY} ${BUNDLE_IDENTIFIER} ${BUGLY_APP_VERSION} ${DWARF_DSYM_FOLDER_PATH} ${SYMBOL_OUTPUT_PATH} ${UPLOAD_DSYM_ONLY}\n fi"; }; /* End PBXShellScriptBuildPhase section */ @@ -15414,7 +15580,9 @@ 88883B221EF0FFB600CAC0AE /* SongNuo128Name.m in Sources */, 8815D1321DFAADC300BEA2DA /* IfishCameraRecordThirdCell.m in Sources */, 887001CF1D794D7B00668C8C /* KanHuViewLastCell.m in Sources */, + E56A746220FCDBFC000129C9 /* ConnectHotpotViewController.m in Sources */, 886D15831E605EEF0085F7D6 /* CustomeLabel.m in Sources */, + E51D7D55208CE08D001FF053 /* CustomModeSetCell.m in Sources */, 8860286E1E10BB1100F3DB5D /* NSBundle+CTAssetsPickerController.m in Sources */, 883E78531D48A5E50030E075 /* TwoControlNinetyninebiteViewController.m in Sources */, 88F5EFDA1D48D08100CC7CAF /* Reachability.m in Sources */, @@ -15572,6 +15740,7 @@ 885928CA1E67EC0400E0011E /* JingYanValuelist.m in Sources */, 886F4E041D76CCDC001EDA34 /* PingfenModel.m in Sources */, 8815D2051E037AFD00BEA2DA /* P2PPlayingbackVC.m in Sources */, + E5317A19211896080014AFDD /* IFishUDPHelperBackMsgModel.m in Sources */, 8815D1241DFA8A6500BEA2DA /* CameraRecordViewController.m in Sources */, 883E78D21D48A5E50030E075 /* NetManager.m in Sources */, 881672231EA5DE2B00BEBF23 /* UMComChangeBorderBtn.m in Sources */, @@ -15615,6 +15784,7 @@ 883E76311D4897570030E075 /* ShopModel.m in Sources */, 88613F711E5C1E86008D2C69 /* IfishFeedListData.m in Sources */, 883E76221D4897570030E075 /* ChatViewModel.m in Sources */, + E51D7D4B208CD528001FF053 /* RuiMeiCHNameCustom.m in Sources */, 88602F711E12002600F3DB5D /* NTESSessionJankenponContentView.m in Sources */, 88602F821E12002600F3DB5D /* NTESNotificationCenter.m in Sources */, 882A760C1EBB27BE00AD1D15 /* ShopCerPart1InfoViewCell.m in Sources */, @@ -15688,6 +15858,7 @@ 88602F561E12002600F3DB5D /* NTESCustomNotificationObject.m in Sources */, 8853D99A1E24EED700776BF4 /* ShuoMingShuCell.m in Sources */, 8816721A1EA5DE2B00BEBF23 /* UMComCustomMenuViewController.m in Sources */, + E5212235210760A600BA24C5 /* SettingResetViewController.m in Sources */, 883E763A1D4897570030E075 /* heartModel.m in Sources */, 883E78971D48A5E50030E075 /* IfishMessageViewController.m in Sources */, 8860287F1E10BB1100F3DB5D /* CTAssetsGridSelectedView.m in Sources */, @@ -15716,6 +15887,7 @@ 881671A51EA5DE2B00BEBF23 /* UMComLikeListDataController.m in Sources */, 88597AC21E56BAF1003D0E5C /* WFTailoringViewController.m in Sources */, 882957FD1DC0443600E9DDD7 /* IfishCardScrollView.m in Sources */, + E51D7D4E208CD5C8001FF053 /* RuiMeiCHControl.m in Sources */, 883E78A01D48A5E50030E075 /* ShotScreenImgViewController.m in Sources */, 88602DB81E10D97E00F3DB5D /* SDWebImagePrefetcher.m in Sources */, 88602F5B1E12002600F3DB5D /* NTESSystemNotificationViewController.m in Sources */, @@ -15931,6 +16103,7 @@ 8867C8761D49B6BC0029F1FA /* TabBarDeviceShouYeCell.m in Sources */, 8815D1281DFAACED00BEA2DA /* IfishCameraRecordfirstCell.m in Sources */, 885979E21E52E38E003D0E5C /* MinekanHuNotSelectShopController.m in Sources */, + E58C998A2081A6930004C42B /* RuiMeiBackMsgUtils.m in Sources */, 88602DB41E10D97E00F3DB5D /* SDWebImageDecoder.m in Sources */, 8815D13C1DFF892A00BEA2DA /* CameraNoParyBackVideoView.m in Sources */, 889133391ECEB97D00F52EBC /* VideoEditeNameViewCell.m in Sources */, @@ -15981,6 +16154,7 @@ 8816721B1EA5DE2B00BEBF23 /* UMComSimplicityDiscoverViewController.m in Sources */, 88C5989D1EA0965B00BDC812 /* LBLaunchImageAdView.m in Sources */, 88602A551E10BC3500F3DB5D /* NIMSessionListViewController.m in Sources */, + E58C9984208195640004C42B /* RuiMeiViewController.m in Sources */, 881A1D051DD2B9F200BA1AF4 /* WoDeKanKanViewController.m in Sources */, 886E6A551D893870009C7724 /* SVIndefiniteAnimatedView.m in Sources */, 88602A2C1E10BC3500F3DB5D /* NIMInputView.m in Sources */, @@ -16037,6 +16211,7 @@ 881478371E712E3A00BFB79C /* TaskKindViewCell.m in Sources */, 8829582B1DC18CD100E9DDD7 /* AFNOHeaderHttpTool.m in Sources */, 886185CD1EF255F900459AD1 /* XuToControlNameViewController.m in Sources */, + E5317A1321188F170014AFDD /* ResetDeviceModel.m in Sources */, 881671FC1EA5DE2B00BEBF23 /* UMAssetsCollectionCheckMarkView.m in Sources */, 881477E61E71091300BFB79C /* IfishTaskModel.m in Sources */, 88C1B2BE1DD1749F00C2C99A /* IfishKanKanListViewController.m in Sources */, @@ -16105,7 +16280,9 @@ 883E76261D4897570030E075 /* DeviceCameraModel.m in Sources */, 88602F571E12002600F3DB5D /* NTESCustomSysNotificationViewController.m in Sources */, 8875B4FB1EDFA406000FAE93 /* RunSun84Protocol.m in Sources */, + E58C99872081A3BA0004C42B /* RuiMeiProtocolModel.m in Sources */, 881671C31EA5DE2B00BEBF23 /* UMComViewController.m in Sources */, + E567026D21187E7C00E61993 /* ConnectHotspotModel.m in Sources */, 883E785D1D48A5E50030E075 /* XuToWenDuPicview.m in Sources */, 880707F51DE302630076F65A /* LXActionView.m in Sources */, 88602A6C1E10BC3500F3DB5D /* NIMPinyinConverter.m in Sources */, @@ -16244,6 +16421,7 @@ 88602A3C1E10BC3500F3DB5D /* NIMCellLayoutConfig.m in Sources */, 882C85A61EB03759001CC414 /* GoldConvertDetailViewCell.m in Sources */, 881477EA1E711B4D00BFB79C /* IfishTaskViewCell.m in Sources */, + E5317A1621188F8A0014AFDD /* RestartDeviceModel.m in Sources */, 88602A591E10BC3500F3DB5D /* NIMTeamCardRowItem.m in Sources */, 886EAC5C1E2DC87E00A4DF27 /* IfishShopInfo.m in Sources */, 886028711E10BB1100F3DB5D /* NSNumberFormatter+CTAssetsPickerController.m in Sources */, @@ -16255,6 +16433,7 @@ 88779EAF1E28BD4200209ABA /* KanHuFuWuViewController.m in Sources */, 88602F661E12002600F3DB5D /* NTESSnapchatAttachment.m in Sources */, 88742C2A1D63F4EA0074F1F8 /* ShopCertificationViewController.m in Sources */, + E5F1B03F21184F9400A879A1 /* IFishHotpotUDPHelper.m in Sources */, 88602DBB1E10D97E00F3DB5D /* UIImage+MultiFormat.m in Sources */, 881671DF1EA5DE2B00BEBF23 /* UMComUserTableViewCell.m in Sources */, 881671EE1EA5DE2B00BEBF23 /* UMComGridView.m in Sources */, @@ -16289,11 +16468,13 @@ 88602FB11E124AF900F3DB5D /* NTESSessionCustomContentConfig.m in Sources */, 881F0F4F1D73DF4E0091507E /* BaoGaoViewFirstCell.m in Sources */, 88F5EFBC1D48D08100CC7CAF /* AsyncSocket.m in Sources */, + E51D7D5B208CF4E7001FF053 /* RuiMeiInputViewController.m in Sources */, 881672241EA5DE2B00BEBF23 /* UMComSelectTopicCell.m in Sources */, 883E78BC1D48A5E50030E075 /* FListManager.m in Sources */, 88602A1B1E10BC3400F3DB5D /* NIMContactDataCell.m in Sources */, 88696FBD1E9C7215005D4AFB /* MemberDetailViewController.m in Sources */, 8816722C1EA5DE2B00BEBF23 /* UMComSimpleFeedTableViewController.m in Sources */, + E51D7D51208CDB5B001FF053 /* RuiMeiSetViewController.m in Sources */, 88602F8B1E12002600F3DB5D /* NTESBadgeView.m in Sources */, 885692B41E82413200C51617 /* IfishBannerData.m in Sources */, 881672091EA5DE2B00BEBF23 /* UMComiToast.m in Sources */, @@ -16518,7 +16699,6 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-1"; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "LaunchImage-1"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libstdc++"; CODE_SIGN_ENTITLEMENTS = Ifish/Ifish.entitlements; @@ -16610,6 +16790,7 @@ PROVISIONING_PROFILE_SPECIFIER = isfishAppstoreDevelopment; TARGETED_DEVICE_FAMILY = 1; USER_HEADER_SEARCH_PATHS = ""; + VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; }; @@ -16617,7 +16798,6 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-1"; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "LaunchImage-1"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libstdc++"; CODE_SIGN_ENTITLEMENTS = Ifish/Ifish.entitlements; @@ -16709,6 +16889,7 @@ PROVISIONING_PROFILE_SPECIFIER = isfishAppstoreDistribution; TARGETED_DEVICE_FAMILY = 1; USER_HEADER_SEARCH_PATHS = ""; + VERSIONING_SYSTEM = "apple-generic"; }; name = Release; }; diff --git a/Ifish/AppDelegate.m b/Ifish/AppDelegate.m index b54633b..78705ae 100644 --- a/Ifish/AppDelegate.m +++ b/Ifish/AppDelegate.m @@ -37,7 +37,7 @@ : NO) #import -#define BUGLY_APPID @"900013241" +#define BUGLY_APPID @"16d2b238e3" #import "TalkingData.h" #define TalkingDataAPPID @"351E6F7956CEF7FB6AABAEB64EF9BF18" #define BMKMAP_APPKEY @"wYcF3YXqeepKfzruExLPn0eS" @@ -166,7 +166,6 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout"; } - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - self.window.backgroundColor=[UIColor whiteColor]; [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:NO]; //崩溃日志 @@ -230,18 +229,7 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout"; _islaunchedByNotification=NO; launchedByNotification = NO; } - - /** - * 初始化Bugly - */ - BuglyConfig *config = [[BuglyConfig alloc] init]; - config.unexpectedTerminatingDetectionEnable = YES; - config.blockMonitorEnable = YES; - config.reportLogLevel = BuglyLogLevelWarn; - [Bugly startWithAppId:BUGLY_APPID config:config]; - //[Bugly startWithAppId:BUGLY_APPID]; - - + /** * TalkingData 统计工具 */ @@ -400,6 +388,17 @@ if (kScreenSize.height>480) { [[AlibcTradeSDK sharedInstance] setIsForceH5:NO]; [self.window makeKeyAndVisible]; + + /** + * 初始化Bugly + */ + BuglyConfig *config = [[BuglyConfig alloc] init]; + config.unexpectedTerminatingDetectionEnable = YES; + config.blockMonitorEnable = YES; + config.debugMode = YES; + config.reportLogLevel = BuglyLogLevelWarn; + [Bugly startWithAppId:BUGLY_APPID config:config]; + return YES; } diff --git a/Ifish/Assets.xcassets/AppIcon-1.appiconset/1231520920961_.pic_hd.jpg b/Ifish/Assets.xcassets/AppIcon-1.appiconset/1231520920961_.pic_hd.jpg new file mode 100644 index 0000000..af733b8 Binary files /dev/null and b/Ifish/Assets.xcassets/AppIcon-1.appiconset/1231520920961_.pic_hd.jpg differ diff --git a/Ifish/Assets.xcassets/hotspotconnect.imageset/4251531889028_.pic.jpg b/Ifish/Assets.xcassets/hotspotconnect.imageset/4251531889028_.pic.jpg new file mode 100644 index 0000000..810526a Binary files /dev/null and b/Ifish/Assets.xcassets/hotspotconnect.imageset/4251531889028_.pic.jpg differ diff --git a/Ifish/Assets.xcassets/hotspotconnect.imageset/Contents.json b/Ifish/Assets.xcassets/hotspotconnect.imageset/Contents.json new file mode 100644 index 0000000..596bab8 --- /dev/null +++ b/Ifish/Assets.xcassets/hotspotconnect.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "4251531889028_.pic.jpg", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Ifish/Base.lproj/LaunchScreen.storyboard b/Ifish/Base.lproj/LaunchScreen.storyboard index 2e721e1..a2980ee 100644 --- a/Ifish/Base.lproj/LaunchScreen.storyboard +++ b/Ifish/Base.lproj/LaunchScreen.storyboard @@ -1,7 +1,12 @@ - - + + + + + - + + + @@ -13,10 +18,20 @@ - + - - + + + + + + + + + + + + @@ -24,4 +39,7 @@ + + + diff --git a/Ifish/Common/CommonMacros.h b/Ifish/Common/CommonMacros.h new file mode 100644 index 0000000..7ca0e47 --- /dev/null +++ b/Ifish/Common/CommonMacros.h @@ -0,0 +1,14 @@ +// +// CommonMacros.h +// Ifish +// +// Created by Minghao Xue on 2018/3/28. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#ifndef CommonMacros_h +#define CommonMacros_h + +#define is_iPhone_X ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO) + +#endif /* CommonMacros_h */ diff --git a/Ifish/Ifish-Prefix.pch b/Ifish/Ifish-Prefix.pch index 80bee86..d4ea3db 100644 --- a/Ifish/Ifish-Prefix.pch +++ b/Ifish/Ifish-Prefix.pch @@ -29,6 +29,8 @@ #import "NIMKit.h" #import +#import "CommonMacros.h" + #define NTES_USE_CLEAR_BAR - (BOOL)useClearBar{return YES;} #define NTES_FORBID_INTERACTIVE_POP - (BOOL)forbidInteractivePop{return YES;} diff --git a/Ifish/Info.plist b/Ifish/Info.plist index 3ba545a..2059f06 100644 --- a/Ifish/Info.plist +++ b/Ifish/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 4.6.3 + 4.6.7 CFBundleSignature ???? CFBundleURLTypes @@ -70,7 +70,7 @@ CFBundleVersion - 4.6.3 + 511 ITSAppUsesNonExemptEncryption LSApplicationCategoryType @@ -375,19 +375,21 @@ NSCameraUsageDescription 使用相机 NSLocationAlwaysUsageDescription - 使用位置服务 + 为获取爱鱼奇智能硬件产品及用户的地址区域分布,以提供更好的特色服务,爱鱼奇将获取您的地址 NSLocationWhenInUseUsageDescription - 使用位置服务 + 为获取爱鱼奇智能硬件产品及用户的地址区域分布,以提供更好的特色服务,爱鱼奇将获取您的地址 NSMicrophoneUsageDescription - 使用麦克风 + 爱鱼奇需要您的同意,才能访问麦克风 NSPhotoLibraryUsageDescription - 使用相册 + 爱鱼奇需要您的同意,才能访问相册 UIApplicationExitsOnSuspend UIBackgroundModes remote-notification + UILaunchStoryboardName + LaunchScreen UIMainStoryboardFile Main UIRequiredDeviceCapabilities diff --git a/Ifish/Utinitys/DataCenter/UserExtendataArchaver.h b/Ifish/Utinitys/DataCenter/UserExtendataArchaver.h index 7f392e9..eb90ab6 100644 --- a/Ifish/Utinitys/DataCenter/UserExtendataArchaver.h +++ b/Ifish/Utinitys/DataCenter/UserExtendataArchaver.h @@ -15,7 +15,13 @@ #import "ThreeControlName.h" #import "FourControlName.h" #import "XuToControlName.h" +#import "RuiMeiCHControl.h" + @interface UserExtendataArchaver : NSObject +//自定义水族箱名字数据 ++(void)archiverRuiMeiDeviceCHInfo:(RuiMeiCHControl*)ch; ++(RuiMeiCHControl*)unArchiverRuiMeiDeviceCHInfo:(NSString *)mac; + //自定义水族箱名字数据 +(void)archiverDeviceCHInfo:(RunSunCHControl*)ch; +(RunSunCHControl*)unArchiverDeviceCHInfo:(NSString *)mac; diff --git a/Ifish/Utinitys/DataCenter/UserExtendataArchaver.m b/Ifish/Utinitys/DataCenter/UserExtendataArchaver.m index e800a43..e80feed 100644 --- a/Ifish/Utinitys/DataCenter/UserExtendataArchaver.m +++ b/Ifish/Utinitys/DataCenter/UserExtendataArchaver.m @@ -9,6 +9,20 @@ #import "UserExtendataArchaver.h" @implementation UserExtendataArchaver + ++(void)archiverRuiMeiDeviceCHInfo:(RuiMeiCHControl*)ch { + NSString *key = [NSString stringWithFormat:@"Ruimei%@",ch.macAd]; + NSString *file = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject stringByAppendingPathComponent:key]; + [NSKeyedArchiver archiveRootObject:ch toFile:file]; +} + ++(RuiMeiCHControl*)unArchiverRuiMeiDeviceCHInfo:(NSString *)mac { + NSString *key = [NSString stringWithFormat:@"Ruimei%@",mac]; + NSString *file = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject stringByAppendingPathComponent:key]; + RuiMeiCHControl *ch = [NSKeyedUnarchiver unarchiveObjectWithFile:file]; + return ch; +} + +(void)archiverDeviceCHInfo:(RunSunCHControl*)ch { NSString *key = [NSString stringWithFormat:@"Rusun%@",ch.macAd]; diff --git a/Ifish/Utinitys/IfishHttpRequest/IFISHHttpTool.h b/Ifish/Utinitys/IfishHttpRequest/IFISHHttpTool.h index f159279..9b7e3c9 100644 --- a/Ifish/Utinitys/IfishHttpRequest/IFISHHttpTool.h +++ b/Ifish/Utinitys/IfishHttpRequest/IFISHHttpTool.h @@ -90,6 +90,17 @@ typedef void(^kanHuShangJia)(CertificationShopModel*kanHuShangJia); -(void)getverifyWithTimerButton:(UIButton*)timeBtn addphoneNumber:(NSString*)phoneNumber zone: (NSString*)areaCode result:(void (^)(NSError *err))result; +/** + * 获取验证码 SMS + * + * @param timeBtn 验证码按钮 + * @param zone 区域号,不要加"+"号(Area code) + * @param isTextCode 是否为短信验证码 + */ + +-(void)getverifyWithTimerButton:(UIButton*)timeBtn addphoneNumber:(NSString*)phoneNumber zone: +(NSString*)areaCode isTextCode:(BOOL)isTextCode result:(void (^)(NSError *err))result; + /** * 注册 diff --git a/Ifish/Utinitys/IfishHttpRequest/IFISHHttpTool.m b/Ifish/Utinitys/IfishHttpRequest/IFISHHttpTool.m index a12c4d3..376c047 100644 --- a/Ifish/Utinitys/IfishHttpRequest/IFISHHttpTool.m +++ b/Ifish/Utinitys/IfishHttpRequest/IFISHHttpTool.m @@ -177,12 +177,12 @@ addPhoneNumber:(NSString*)phoneNumber addSendType:(NSString*)sendType backData:(backVerifyCode)backVerifyCodeblock{ - [self timerFireWithTimerButton:timeBtn addPhoneNumber:phoneNumber]; + [self timerFireWithTimerButton:timeBtn addPhoneNumber:phoneNumber timeBtnFinalTitle:@"语音验证码"]; [self getverifyWithTimerButton:timeBtn addphoneNumber:phoneNumber AddSendType:sendType backData:backVerifyCodeblock]; } #pragma mark 倒计时 --(void)timerFireWithTimerButton:(UIButton*)timeBtn addPhoneNumber:(NSString*)phoneNumber{ +-(void)timerFireWithTimerButton:(UIButton*)timeBtn addPhoneNumber:(NSString*)phoneNumber timeBtnFinalTitle:(NSString *)title{ __block int timeout=60; //倒计时时间 @@ -195,7 +195,7 @@ dispatch_async(dispatch_get_main_queue(), ^{ //设置界面的按钮显示 根据自己需求设置 - [timeBtn setTitle:@"语音验证码" forState:UIControlStateNormal]; + [timeBtn setTitle:title forState:UIControlStateNormal]; timeBtn.userInteractionEnabled = YES; //timeBtn.backgroundColor=COLOR_LABEL_TITLE; [timeBtn setBackgroundImage:[UIImage imageNamed:@"registered_icon_validation"] forState:UIControlStateNormal]; @@ -232,7 +232,7 @@ dispatch_source_cancel(_timer1); dispatch_async(dispatch_get_main_queue(), ^{ //设置界面的按钮显示 根据自己需求设置 - [timeBtn setTitle:@"语音验证码" forState:UIControlStateNormal]; + [timeBtn setTitle:title forState:UIControlStateNormal]; timeBtn.userInteractionEnabled = YES; //timeBtn.backgroundColor=COLOR_LABEL_TITLE; [timeBtn setBackgroundImage:[UIImage imageNamed:@"registered_icon_validation"] forState:UIControlStateNormal]; @@ -311,11 +311,42 @@ #pragma mark - SMS 新 -(void)getverifyWithTimerButton:(UIButton*)timeBtn addphoneNumber:(NSString*)phoneNumber zone: -(NSString*)areaCode result:(void (^)(NSError *err))result +(NSString*)areaCode isTextCode:(BOOL)isTextCode result:(void (^)(NSError *))result + +{ + NSString *title = isTextCode ? @"短信验证码" : @"语音验证码"; + + [self timerFireWithTimerButton:timeBtn addPhoneNumber:phoneNumber timeBtnFinalTitle:title]; + + [SMSSDK getVerificationCodeByMethod:isTextCode ? SMSGetCodeMethodSMS : SMSGetCodeMethodVoice phoneNumber:phoneNumber zone:areaCode customIdentifier:nil result:^(NSError *error) { + + if (!error) { + NSLog(@"获取验证码成功"); + + } else { + NSLog(@"错误信息:%@",error); + dispatch_source_cancel(_timer1); + dispatch_async(dispatch_get_main_queue(), ^{ + //设置界面的按钮显示 根据自己需求设置 + [timeBtn setTitle:title forState:UIControlStateNormal]; + timeBtn.userInteractionEnabled = YES; + //timeBtn.backgroundColor=COLOR_LABEL_TITLE; + [timeBtn setBackgroundImage:[UIImage imageNamed:@"registered_icon_validation"] forState:UIControlStateNormal]; + + }); + [self showTitle:@"" messsage:@"获取验证失败"]; + + } + + }]; +} + +-(void)getverifyWithTimerButton:(UIButton*)timeBtn addphoneNumber:(NSString*)phoneNumber zone: +(NSString*)areaCode result:(void (^)(NSError *))result { - [self timerFireWithTimerButton:timeBtn addPhoneNumber:phoneNumber]; + [self timerFireWithTimerButton:timeBtn addPhoneNumber:phoneNumber timeBtnFinalTitle:@"语音验证码"]; [SMSSDK getVerificationCodeByMethod:SMSGetCodeMethodVoice phoneNumber:phoneNumber zone:areaCode customIdentifier:nil result:^(NSError *error) { diff --git a/Ifish/Utinitys/IfishHttpRequest/IfishDataUnity.h b/Ifish/Utinitys/IfishHttpRequest/IfishDataUnity.h index 9259ece..0cef2bf 100644 --- a/Ifish/Utinitys/IfishHttpRequest/IfishDataUnity.h +++ b/Ifish/Utinitys/IfishHttpRequest/IfishDataUnity.h @@ -19,6 +19,8 @@ #import "RuSunHaveHeateViewController.h" #import "SongNuoDBCenterViewController.h" #import "RunSun84biteCenterViewController.h" +#import "RuiMeiViewController.h" + //默认选中 下表类型 //typedef NS_ENUM (NSInteger,saveIndexType){ // diff --git a/Ifish/Utinitys/IfishHttpRequest/IfishDataUnity.m b/Ifish/Utinitys/IfishHttpRequest/IfishDataUnity.m index 86feaba..c4c88df 100644 --- a/Ifish/Utinitys/IfishHttpRequest/IfishDataUnity.m +++ b/Ifish/Utinitys/IfishHttpRequest/IfishDataUnity.m @@ -140,6 +140,15 @@ [nav.navigationBar setBackgroundImage:[UIImage imageNamed:@"blackbar.png"] forBarMetrics:UIBarMetricsDefault]; app1.window.rootViewController=nav; + } else if ([devicemodel.type isEqualToString:DECICE_TYPE_RUIMEI]) { + RuiMeiViewController *ruimeiCenter=[[RuiMeiViewController alloc] init]; + ruimeiCenter.currentDevice = devicemodel; + UIApplication*app=[UIApplication sharedApplication]; + AppDelegate*app1=(AppDelegate*)app.delegate; + UINavigationController*nav=[[UINavigationController alloc]initWithRootViewController:ruimeiCenter]; + [nav.navigationBar setBackgroundImage:[UIImage imageNamed:@"blackbar.png"] forBarMetrics:UIBarMetricsDefault]; + app1.window.rootViewController=nav; + }else{ int controlAmount=[devicemodel.controlAmount intValue]; diff --git a/Ifish/Utinitys/IfishUtils/IfishDeviceInfo.h b/Ifish/Utinitys/IfishUtils/IfishDeviceInfo.h index b47c6e8..58899b6 100644 --- a/Ifish/Utinitys/IfishUtils/IfishDeviceInfo.h +++ b/Ifish/Utinitys/IfishUtils/IfishDeviceInfo.h @@ -46,5 +46,7 @@ //睿芯 独立 84 字节 #define DECICE_TYPE_RUSUN2A @"2a" //0x2a +//瑞美4控 +#define DECICE_TYPE_RUIMEI @"2b" #endif /* IfishDeviceInfo_h */ diff --git a/Ifish/Utinitys/IfishUtils/UINavigationBar+Background.m b/Ifish/Utinitys/IfishUtils/UINavigationBar+Background.m index bb1848d..e968ad8 100755 --- a/Ifish/Utinitys/IfishUtils/UINavigationBar+Background.m +++ b/Ifish/Utinitys/IfishUtils/UINavigationBar+Background.m @@ -26,6 +26,11 @@ static char overlayKey; if (!self.overlay) { [self setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; self.overlay = [[UIView alloc] initWithFrame:CGRectMake(0, -20, [UIScreen mainScreen].bounds.size.width, CGRectGetHeight(self.bounds) + 20)]; + if (@available(iOS 11.0, *)) { + self.overlay = [[UIView alloc] initWithFrame:CGRectMake(0, -44, [UIScreen mainScreen].bounds.size.width, CGRectGetHeight(self.bounds) + 44)]; + } else { + self.overlay = [[UIView alloc] initWithFrame:CGRectMake(0, -20, [UIScreen mainScreen].bounds.size.width, CGRectGetHeight(self.bounds) + 20)]; + } self.overlay.userInteractionEnabled = NO; self.overlay.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; [self insertSubview:self.overlay atIndex:0]; diff --git a/Ifish/YunXinIM/NIMKit/NIMKit/Sections/Session/Object/NIMSessionTableAdapter.m b/Ifish/YunXinIM/NIMKit/NIMKit/Sections/Session/Object/NIMSessionTableAdapter.m index ca2d8fa..bcdf268 100755 --- a/Ifish/YunXinIM/NIMKit/NIMKit/Sections/Session/Object/NIMSessionTableAdapter.m +++ b/Ifish/YunXinIM/NIMKit/NIMKit/Sections/Session/Object/NIMSessionTableAdapter.m @@ -29,6 +29,8 @@ UITableViewCell *cell = nil; id model = [[self.interactor items] objectAtIndex:indexPath.row]; if ([model isKindOfClass:[NIMMessageModel class]]) { + [model calculateContent:tableView.bounds.size.width force:NO]; + cell = [NIMMessageCellFactory cellInTable:tableView forMessageMode:model]; [(NIMMessageCell *)cell setDelegate:self.delegate]; diff --git a/Ifish/controllers/BaseVIewContorller/BaseVIewContorller.m b/Ifish/controllers/BaseVIewContorller/BaseVIewContorller.m index 44c40db..968f977 100644 --- a/Ifish/controllers/BaseVIewContorller/BaseVIewContorller.m +++ b/Ifish/controllers/BaseVIewContorller/BaseVIewContorller.m @@ -56,7 +56,7 @@ // self.navigationItem.backBarButtonItem=backItem; _bakbutton = [UIButton buttonWithType:UIButtonTypeCustom]; _bakbutton.frame = CGRectMake(0,0,48,44); - [_bakbutton setImage:[UIImage imageNamed:@"arrow_l"] forState:UIControlStateNormal]; + [_bakbutton setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal]; [_bakbutton addTarget: self action: @selector(goBackAction) forControlEvents: UIControlEventTouchUpInside]; diff --git a/Ifish/controllers/BaseVIewContorller/ClearNavBaseViewController.m b/Ifish/controllers/BaseVIewContorller/ClearNavBaseViewController.m index e488d55..7a13cf0 100644 --- a/Ifish/controllers/BaseVIewContorller/ClearNavBaseViewController.m +++ b/Ifish/controllers/BaseVIewContorller/ClearNavBaseViewController.m @@ -47,7 +47,7 @@ _bakbutton = [UIButton buttonWithType:UIButtonTypeCustom]; _bakbutton.frame = CGRectMake(0,0,48,44); - [_bakbutton setImage:[UIImage imageNamed:@"arrow_l"] forState:UIControlStateNormal]; + [_bakbutton setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal]; [_bakbutton addTarget: self action: @selector(goBackAction) forControlEvents: UIControlEventTouchUpInside]; diff --git a/Ifish/controllers/BaseVIewContorller/FatherController.m b/Ifish/controllers/BaseVIewContorller/FatherController.m index 3d45d62..9ed87e9 100644 --- a/Ifish/controllers/BaseVIewContorller/FatherController.m +++ b/Ifish/controllers/BaseVIewContorller/FatherController.m @@ -21,12 +21,7 @@ } -(void)setNav{ - UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; - btn.frame = CGRectMake(2, 5,47, 44); - [btn setBackgroundImage:[UIImage imageNamed:@"arrow_l"] forState:UIControlStateNormal]; - [btn addTarget: self action: @selector(goBackAction) forControlEvents: UIControlEventTouchUpInside]; - - UIBarButtonItem*back=[[UIBarButtonItem alloc]initWithCustomView:btn]; + UIBarButtonItem*back=[[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"back_btn"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStyleDone target:self action:@selector(goBackAction)]; self.navigationItem.leftBarButtonItem=back; } - (void)addTitleViewWithTitle:(NSString *)title{ diff --git a/Ifish/controllers/BaseVIewContorller/WhiteNavBaseViewController.m b/Ifish/controllers/BaseVIewContorller/WhiteNavBaseViewController.m index ab11303..dd5177d 100644 --- a/Ifish/controllers/BaseVIewContorller/WhiteNavBaseViewController.m +++ b/Ifish/controllers/BaseVIewContorller/WhiteNavBaseViewController.m @@ -43,18 +43,8 @@ } -(void)initNav{ - // 1. 可以改变全栈back按钮 图片 60*60 @2x像素 - - _bakbutton = [UIButton buttonWithType:UIButtonTypeCustom]; - _bakbutton.frame = CGRectMake(0,0,48,44); - [_bakbutton setImage:[UIImage imageNamed:@"arrow_b"] forState:UIControlStateNormal]; - - - [_bakbutton addTarget: self action: @selector(goBackAction) forControlEvents: UIControlEventTouchUpInside]; - - _back=[[UIBarButtonItem alloc] initWithCustomView:_bakbutton]; + _back =[[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"back_btn_1"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStyleDone target:self action:@selector(goBackAction)]; self.navigationItem.leftBarButtonItem=_back; - } -(void)goBackAction{ diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterViewController.m b/Ifish/controllers/FishTinkController/maincontroller/CenterViewController.m index ad8fe3a..06e0295 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterViewController.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterViewController.m @@ -127,7 +127,7 @@ // 左侧按钮背景 - UIImage *hamburger = [UIImage imageNamed:@"arrow_l"]; + UIImage *hamburger = [[UIImage imageNamed:@"back_btn"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; self.openDrawerButton = [UIButton buttonWithType:UIButtonTypeCustom]; self.openDrawerButton.frame = CGRectMake(0, 0, 47,44); [self.openDrawerButton setImage:hamburger forState:UIControlStateNormal]; @@ -135,8 +135,6 @@ [self.openDrawerButton addTarget:self action:@selector(leftBtnGoBackAction) forControlEvents:UIControlEventTouchUpInside]; UIBarButtonItem *leftItem=[[UIBarButtonItem alloc] initWithImage:hamburger style:UIBarButtonItemStylePlain target:self action:@selector(leftBtnGoBackAction)]; - - leftItem.customView = self.openDrawerButton; self.navigationItem.leftBarButtonItem = leftItem; diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/FourControl/FourControlName.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/FourControl/FourControlName.m index f22a5c7..3efbec0 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/FourControl/FourControlName.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/FourControl/FourControlName.m @@ -14,7 +14,7 @@ [aCoder encodeObject:_light1 forKey:@"light1"]; [aCoder encodeObject:_light2 forKey:@"light2"]; - + [aCoder encodeObject:_uvName forKey:@"uvName"]; [aCoder encodeObject:_pumpName forKey:@"pumpName"]; [aCoder encodeObject:_macAddress forKey:@"macAddress"]; } @@ -24,6 +24,7 @@ self.light1=[aDecoder decodeObjectForKey:@"light1"]; self.light2=[aDecoder decodeObjectForKey:@"light2"]; + self.uvName = [aDecoder decodeObjectForKey:@"uvName"]; self.pumpName=[aDecoder decodeObjectForKey:@"pumpName"]; self.macAddress = [aDecoder decodeObjectForKey:@"macAddress"]; diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/FourControl/FourControlNameViewController.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/FourControl/FourControlNameViewController.m index b4605f0..1112881 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/FourControl/FourControlNameViewController.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/FourControl/FourControlNameViewController.m @@ -123,7 +123,7 @@ [self.view makeToast:@"UV不能为空"]; return; } - name.uvName = cell2.chName.text; + name.uvName = cell3.chName.text; RuSunChangeNameTextViewCell*cell4 = [self.view viewWithTag:FOURCHCELL_PUMP]; if (cell4.chName.text.length>3) { diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/FourControl/FourControlNormalCenterController.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/FourControl/FourControlNormalCenterController.m index 70212e4..2f21afa 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/FourControl/FourControlNormalCenterController.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/FourControl/FourControlNormalCenterController.m @@ -90,9 +90,14 @@ self.button.tag=231+i; + CGFloat y = 0; + if (is_iPhone_X) { + y = kScreenSize.height -180 - 34 + 10; + } else { + y = kScreenSize.height -180 + 10; + } - - self.button.frame=CGRectMake((wspace+i * (btnwidth+wspace)), (kScreenSize.height -180 + 10),btnwidth, btnwidth * 243/210); + self.button.frame=CGRectMake((wspace+i * (btnwidth+wspace)), y,btnwidth, btnwidth * 243/210); [self.button setImage:[UIImage imageNamed:nomalarr[i]] forState:UIControlStateNormal]; [self.button addTarget:self action:@selector(fourControlBtnCilck:) forControlEvents:UIControlEventTouchUpInside]; @@ -118,8 +123,13 @@ NSArray*arry=@[@"灯1",@"灯2",@"UV杀菌",@"冲浪/氧泵"]; for (int j=0; j +#import "RuiMeiProtocolModel.h" + +#define DataCenterRuiMeiModelKey @"DataCenterRuiMeiModelKey" + +@interface RuiMeiBackMsgUtils : NSObject + +/** + * save soket massage control + */ ++(void)readSoketDataWithBaackMassgModel:(RuiMeiProtocolModel*)ruSunModel + addWithBackData:(NSData*)data; + +/** + * setTemperaturelabel + */ ++(void)setTemperaturelabel:(UILabel*)temperaturelabel + addbubleImge:(UIImageView*)bubleImg + WithBackData:(NSData*)data + addWithBackMassageModel:(RuiMeiProtocolModel*)backModel + addWithTableview:(UITableView*)tableview; +/** + * light state + */ + ++(void)resetRuSunCHState:(UIButton*)ch1 + ch2:(UIButton*)ch2 + ch3:(UIButton*)ch3 + ch4:(UIButton*)ch4 + andJiaRe:(UIButton*)jiaReBang + withBackModel:(RuiMeiProtocolModel*)backModel; +/** + * refresh setViewData + */ ++(NSArray*)refreshRuSunTimerAddTemperatureWithBackMassageModel:(RuiMeiProtocolModel*)backModel; + +@end diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiBackMsgUtils.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiBackMsgUtils.m new file mode 100644 index 0000000..0728b27 --- /dev/null +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiBackMsgUtils.m @@ -0,0 +1,231 @@ +// +// RuiMeiBackMsgUtils.m +// Ifish +// +// Created by Minghao Xue on 2018/4/14. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import "RuiMeiBackMsgUtils.h" + +@implementation RuiMeiBackMsgUtils + ++(void)readSoketDataWithBaackMassgModel:(RuiMeiProtocolModel*)ruSunModel + addWithBackData:(NSData*)data +{ + + NSString*totalString=[dataContorl dataToHexString:data]; + //无运行模式 + ruSunModel.ch1=[totalString substringWithRange:NSMakeRange(30, 4)]; + ruSunModel.ch2=[totalString substringWithRange:NSMakeRange(34, 4)]; + ruSunModel.ch3 = [totalString substringWithRange:NSMakeRange(38, 4)]; + ruSunModel.ch4 = [totalString substringWithRange:NSMakeRange(42, 4)]; + ruSunModel.customModel = [totalString substringWithRange:NSMakeRange(46, 4)]; + ruSunModel.timer1=[totalString substringWithRange:NSMakeRange(50,12)]; + ruSunModel.timer2=[totalString substringWithRange:NSMakeRange(62, 12)]; + ruSunModel.timer3=[totalString substringWithRange:NSMakeRange(74, 12)]; + ruSunModel.timer4=[totalString substringWithRange:NSMakeRange(86, 12)]; + ruSunModel.timer5=[totalString substringWithRange:NSMakeRange(98, 12)]; + ruSunModel.timer6=[totalString substringWithRange:NSMakeRange(110, 12)]; + ruSunModel.timer7=[totalString substringWithRange:NSMakeRange(122, 12)]; + ruSunModel.timer8=[totalString substringWithRange:NSMakeRange(134, 12)]; + ruSunModel.heatStickState=[totalString substringWithRange:NSMakeRange(146, 2)];//16进制型 + ruSunModel.wendu=[totalString substringWithRange:NSMakeRange(148, 4)]; + ruSunModel.heatTemperature=[totalString substringWithRange:NSMakeRange(152, 4)]; + ruSunModel.shiwen = [totalString substringWithRange:NSMakeRange(156, 4)]; + ruSunModel.baojingSwitch=[totalString substringWithRange:NSMakeRange(160, 2)]; + ruSunModel.miniTp=[totalString substringWithRange:NSMakeRange(162, 4)]; + ruSunModel.maxTp=[totalString substringWithRange:NSMakeRange(166, 4)]; + ruSunModel.funcCode= [totalString substringWithRange:NSMakeRange(170, 4)]; + [[DataCenter defaultDtacenter] setValue:ruSunModel forKey:DataCenterRuiMeiModelKey]; + +} + ++(void)setTemperaturelabel:(UILabel*)temperaturelabel + addbubleImge:(UIImageView*)bubleImg + WithBackData:(NSData*)data + addWithBackMassageModel:(RuiMeiProtocolModel*)backModel + addWithTableview:(UITableView*)tableview +{ + + + NSString*str=[dataContorl dataToHexString:data]; + str=[str substringWithRange:NSMakeRange(148,4)]; + UInt64 mac=[dataContorl hexToTen:str]; + float TPlabel=mac/10+(mac%10)*0.1; + NSString *stringFloat = [NSString stringWithFormat:@"%.1f",TPlabel]; + NSLog(@"%@",stringFloat); + dispatch_async(dispatch_get_main_queue(), ^{ + if (mac==0) { + + temperaturelabel.text=@"00.0"; + + }else{ + + temperaturelabel.text=stringFloat; + } + }); +} ++(void)resetRuSunCHState:(UIButton*)ch1 + ch2:(UIButton*)ch2 + ch3:(UIButton*)ch3 + ch4:(UIButton*)ch4 + andJiaRe:(UIButton*)jiaReBang + withBackModel:(RuiMeiProtocolModel*)backModel +{ + + // ch1 + + NSString*stateString1=[backModel.ch1 substringWithRange:NSMakeRange(2, 2)]; + + if ([stateString1 isEqualToString:@"01"]) { + [ch1 setImage:[UIImage imageNamed:@"PFLight1_on"] forState:UIControlStateNormal]; + ch1.selected=YES; + }else{ + [ch1 setImage:[UIImage imageNamed:@"PFLight1_off"] forState:UIControlStateNormal]; + ch1.selected=NO; + + } + // ch2 + + NSString*stateString2=[backModel.ch2 substringWithRange:NSMakeRange(2, 2)]; + + if ([stateString2 isEqualToString:@"01"]) { + [ch2 setImage:[UIImage imageNamed:@"PFLight1_on"] forState:UIControlStateNormal]; + ch2.selected=YES; + }else{ + [ch2 setImage:[UIImage imageNamed:@"PFLight1_off"] forState:UIControlStateNormal]; + ch2.selected=NO; + } + + // ch3 + + NSString*stateString3=[backModel.ch3 substringWithRange:NSMakeRange(2, 2)]; + + if ([stateString3 isEqualToString:@"01"]){ + + [ch3 setImage:[UIImage imageNamed:@"PFkilLlight_on"] forState:UIControlStateNormal]; + ch3.selected=YES; + + }else{ + [ch3 setImage:[UIImage imageNamed:@"PFkilLlight_off"] forState:UIControlStateNormal]; + ch3.selected=NO; + + } + + // ch4 + + NSString*stateString4=[backModel.ch4 substringWithRange:NSMakeRange(2, 2)]; + + if ([stateString4 isEqualToString:@"01"]){ + + [ch4 setImage:[UIImage imageNamed:@"O2_on"] forState:UIControlStateNormal]; + ch4.selected=YES; + + }else{ + [ch4 setImage:[UIImage imageNamed:@"O2_off"] forState:UIControlStateNormal]; + ch4.selected=NO; + + } + + // 加热制冷 状态 1字节 + NSString*stateString6=[backModel.heatStickState substringWithRange:NSMakeRange(0, 2)]; + UInt64 mac=[dataContorl hexToTen:backModel.heatTemperature]; + float TPlabel=mac/10; + int temp= (int)(TPlabel+0.5); + NSString *stringFloat = [NSString stringWithFormat:@"%d",temp]; + UILabel *lbl = [jiaReBang viewWithTag:1]; + if ([stateString6 isEqualToString:@"01"]){ + //加热 + lbl.textColor = JWUIColorFromRGB(0x38b9fc); + }else{ + lbl.textColor = [UIColor lightGrayColor]; + } + lbl.text = [NSString stringWithFormat:@"%@°C", stringFloat]; + +} + ++(NSArray*)refreshRuSunTimerAddTemperatureWithBackMassageModel:(RuiMeiProtocolModel*)backModel +{ + NSArray*timerArr=[[NSArray alloc]init]; + NSString*low=backModel.miniTp; + NSString*heigh=backModel.maxTp; + UInt64 lowten=[dataContorl hexToTen:low]; + UInt64 heighten=[dataContorl hexToTen:heigh]; + float formatlow=lowten/10; + float formatheigh=heighten/10; + + NSString*wenduString=[NSString stringWithFormat:@"%.0f~%.0f°C",formatlow,formatheigh]; + + // 十六进制 + NSString*startTimeHex1=[backModel.timer1 substringWithRange:NSMakeRange(4, 4)]; + NSString*endTimeHex1=[backModel.timer1 substringWithRange:NSMakeRange(8, 4)]; + + // 十进制 + NSString*startTimeTen1=[dataContorl hexStringToDateString:startTimeHex1]; + NSString*endTimeTen1=[dataContorl hexStringToDateString:endTimeHex1]; + NSString*setTim1=[NSString stringWithFormat:@"%@~%@",startTimeTen1,endTimeTen1]; + // 十六进制 + NSString*startTimeHex2=[backModel.timer2 substringWithRange:NSMakeRange(4, 4)]; + NSString*endTimeHex2=[backModel.timer2 substringWithRange:NSMakeRange(8, 4)]; + // 十进制 + NSString*startTimeTen2=[dataContorl hexStringToDateString:startTimeHex2]; + NSString*endTimeTen2=[dataContorl hexStringToDateString:endTimeHex2]; + NSString*setTim2=[NSString stringWithFormat:@"%@~%@",startTimeTen2,endTimeTen2]; + + // 十六进制 + NSString*startTimeHex3=[backModel.timer3 substringWithRange:NSMakeRange(4, 4)]; + NSString*endTimeHex3=[backModel.timer3 substringWithRange:NSMakeRange(8, 4)]; + // 十进制 + NSString*startTimeTen3=[dataContorl hexStringToDateString:startTimeHex3]; + NSString*endTimeTen3=[dataContorl hexStringToDateString:endTimeHex3]; + NSString*setTim3=[NSString stringWithFormat:@"%@~%@",startTimeTen3,endTimeTen3]; + + // 十六进制 + NSString*startTimeHex4=[backModel.timer4 substringWithRange:NSMakeRange(4, 4)]; + NSString*endTimeHex4=[backModel.timer4 substringWithRange:NSMakeRange(8, 4)]; + // 十进制 + NSString*startTimeTen4=[dataContorl hexStringToDateString:startTimeHex4]; + NSString*endTimeTen4=[dataContorl hexStringToDateString:endTimeHex4]; + NSString*setTim4=[NSString stringWithFormat:@"%@~%@",startTimeTen4,endTimeTen4]; + + // 十六进制 + NSString*startTimeHex5=[backModel.timer5 substringWithRange:NSMakeRange(4, 4)]; + NSString*endTimeHex5=[backModel.timer5 substringWithRange:NSMakeRange(8, 4)]; + // 十进制 + NSString*startTimeTen5=[dataContorl hexStringToDateString:startTimeHex5]; + NSString*endTimeTen5=[dataContorl hexStringToDateString:endTimeHex5]; + NSString*setTim5=[NSString stringWithFormat:@"%@~%@",startTimeTen5,endTimeTen5]; + + // 十六进制 + NSString*startTimeHex6=[backModel.timer6 substringWithRange:NSMakeRange(4, 4)]; + NSString*endTimeHex6=[backModel.timer6 substringWithRange:NSMakeRange(8, 4)]; + // 十进制 + NSString*startTimeTen6=[dataContorl hexStringToDateString:startTimeHex6]; + NSString*endTimeTen6=[dataContorl hexStringToDateString:endTimeHex6]; + NSString*setTim6=[NSString stringWithFormat:@"%@~%@",startTimeTen6,endTimeTen6]; + + // 十六进制 + NSString*startTimeHex7=[backModel.timer7 substringWithRange:NSMakeRange(4, 4)]; + NSString*endTimeHex7=[backModel.timer7 substringWithRange:NSMakeRange(8, 4)]; + // 十进制 + NSString*startTimeTen7=[dataContorl hexStringToDateString:startTimeHex7]; + NSString*endTimeTen7=[dataContorl hexStringToDateString:endTimeHex7]; + NSString*setTim7=[NSString stringWithFormat:@"%@~%@",startTimeTen7,endTimeTen7]; + + // 十六进制 + NSString*startTimeHex8=[backModel.timer8 substringWithRange:NSMakeRange(4, 4)]; + NSString*endTimeHex8=[backModel.timer8 substringWithRange:NSMakeRange(8, 4)]; + // 十进制 + NSString*startTimeTen8=[dataContorl hexStringToDateString:startTimeHex8]; + NSString*endTimeTen8=[dataContorl hexStringToDateString:endTimeHex8]; + NSString*setTim8=[NSString stringWithFormat:@"%@~%@",startTimeTen8,endTimeTen8]; + + timerArr=@[@[wenduString,@"设置时段"],@[setTim1,setTim2],@[setTim3,setTim4],@[setTim5,setTim6],@[setTim7,setTim8,@""]]; + + return timerArr; + + +} + +@end diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiCHControl.h b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiCHControl.h new file mode 100644 index 0000000..1beb8b1 --- /dev/null +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiCHControl.h @@ -0,0 +1,18 @@ +// +// RuiMeiCHControl.h +// Ifish +// +// Created by Minghao Xue on 2018/4/22. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import + +@interface RuiMeiCHControl : NSObject +@property (nonatomic,copy) NSString *ch1name; +@property (nonatomic,copy) NSString *ch2name; +@property (nonatomic,copy) NSString *ch3name; +@property (nonatomic,copy) NSString *ch4name; +@property (nonatomic,copy) NSString *jiaRe; +@property (nonatomic,copy) NSString *macAd; +@end diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiCHControl.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiCHControl.m new file mode 100644 index 0000000..46d66d8 --- /dev/null +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiCHControl.m @@ -0,0 +1,36 @@ +// +// RuiMeiCHControl.m +// Ifish +// +// Created by Minghao Xue on 2018/4/22. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import "RuiMeiCHControl.h" + +@implementation RuiMeiCHControl + +-(void)encodeWithCoder:(NSCoder*)aCoder{ + + [aCoder encodeObject:_ch1name forKey:@"ch1name"]; + [aCoder encodeObject:_ch2name forKey:@"ch2name"]; + [aCoder encodeObject:_ch3name forKey:@"ch3name"]; + [aCoder encodeObject:_ch4name forKey:@"ch4name"]; + [aCoder encodeObject:_macAd forKey:@"macaddress"]; + [aCoder encodeObject:_jiaRe forKey:@"jiaRe"]; +} + +-(id)initWithCoder:(NSCoder*)aDecoder{ + if (self=[super init]) { + self.ch1name=[aDecoder decodeObjectForKey:@"ch1name"]; + self.ch2name=[aDecoder decodeObjectForKey:@"ch2name"]; + self.ch3name=[aDecoder decodeObjectForKey:@"ch3name"]; + self.ch4name=[aDecoder decodeObjectForKey:@"ch4name"]; + self.macAd = [aDecoder decodeObjectForKey:@"macaddress"]; + self.jiaRe = [aDecoder decodeObjectForKey:@"jiaRe"]; + } + + return self; +} + +@end diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiCHNameCustom.h b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiCHNameCustom.h new file mode 100644 index 0000000..093bd3f --- /dev/null +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiCHNameCustom.h @@ -0,0 +1,17 @@ +// +// RuiMeiCHNameCustom.h +// Ifish +// +// Created by Minghao Xue on 2018/4/22. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import +#import "RuiMeiCHControl.h" + +@interface RuiMeiCHNameCustom : NSObject + ++(void)saveCHname:(RuiMeiCHControl*)chModel; ++(RuiMeiCHControl *)currentdevice:(NSString *)macaddress; + +@end diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiCHNameCustom.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiCHNameCustom.m new file mode 100644 index 0000000..9de64ae --- /dev/null +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiCHNameCustom.m @@ -0,0 +1,36 @@ +// +// RuiMeiCHNameCustom.m +// Ifish +// +// Created by Minghao Xue on 2018/4/22. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import "RuiMeiCHNameCustom.h" +#import "UserExtendataArchaver.h" + +@implementation RuiMeiCHNameCustom + ++(void)saveCHname:(RuiMeiCHControl*)chModel +{ + + [UserExtendataArchaver archiverRuiMeiDeviceCHInfo:chModel]; + +} + ++(RuiMeiCHControl *)currentdevice:(NSString *)macaddress +{ + RuiMeiCHControl *runsunCH = [UserExtendataArchaver unArchiverRuiMeiDeviceCHInfo:macaddress]; + if (!runsunCH||[runsunCH isKindOfClass:[NSNull class]]) { + runsunCH = [[RuiMeiCHControl alloc] init]; + runsunCH.ch1name = @"灯1"; + runsunCH.ch2name = @"灯2"; + runsunCH.ch3name = @"UV/杀菌"; + runsunCH.ch4name = @"冲浪/氧泵"; + runsunCH.jiaRe = @"加热棒"; + runsunCH.macAd = macaddress; + } + return runsunCH; +} + +@end diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiInputViewController.h b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiInputViewController.h new file mode 100644 index 0000000..28a46a1 --- /dev/null +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiInputViewController.h @@ -0,0 +1,13 @@ +// +// RuiMeiInputViewController.h +// Ifish +// +// Created by Minghao Xue on 2018/4/23. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import "IfishDeviceControlNameBaseController.h" + +@interface RuiMeiInputViewController : IfishDeviceControlNameBaseController + +@end diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiInputViewController.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiInputViewController.m new file mode 100644 index 0000000..655b302 --- /dev/null +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiInputViewController.m @@ -0,0 +1,157 @@ +// +// RuiMeiInputViewController.m +// Ifish +// +// Created by Minghao Xue on 2018/4/23. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import "RuiMeiInputViewController.h" +#import "RuSunChangeNameTextViewCell.h" +#define RUSUNCHCELL_CH1 20000 +#define RUSUNCHCELL_CH2 20001 +#define RUSUNCHCELL_CH3 20002 +#define RUSUNCHCELL_CH4 20003 +#define RUSUNCHCELL_JIARE 20004 +#import "RuiMeiCHNameCustom.h" +#import "RuiMeiCHControl.h" +#import "UserExtendataArchaver.h" + +@interface RuiMeiInputViewController () + +@end + +@implementation RuiMeiInputViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + self.tableView.dataSource =self; +} +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ + + if (section==0) { + + return 1; + + }else{ + + return 5; + } +} + +-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ + + return 2; +} + +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ + + if (indexPath.section==0) { + + return [super baseViewLoadDeviceNameCell:indexPath intable:tableView]; + } + + RuSunChangeNameTextViewCell*cell=[tableView dequeueReusableCellWithIdentifier:@"RuSunChangeNameTextViewCell"]; + if (cell==nil) { + cell= [[[NSBundle mainBundle]loadNibNamed:@"RuSunChangeNameTextViewCell" owner:self options:nil]lastObject]; + + } + + //控制原名 + if (indexPath.row==4&&indexPath.section==1) { + cell.lineImgView.image = [UIImage imageNamed:@"redact_line_last"]; + + } + NSArray *titles= @[@"灯1",@"灯2",@"UV/杀菌",@"冲浪/氧泵",@"加热棒"]; + if (indexPath.section==1) { + cell.chTitle.text = titles[indexPath.row]; + } + + //自定义名字 + RuiMeiCHControl * ruSunch = [RuiMeiCHNameCustom currentdevice:self.device.macAddress]; + if (indexPath.section==1&&indexPath.row==0) { + cell.chName.text = ruSunch.ch1name; + + }else if (indexPath.section==1&&indexPath.row==1){ + cell.chName.text = ruSunch.ch2name; + }else if (indexPath.section==1&&indexPath.row==2){ + cell.chName.text = ruSunch.ch3name; + }else if (indexPath.section==1&&indexPath.row==3){ + cell.chName.text = ruSunch.ch4name; + }else if (indexPath.section==1&&indexPath.row==4){ + cell.chName.text = ruSunch.jiaRe; + } + + cell.chName.delegate = self; + cell.tag = 20000 + indexPath.row; + return cell; +} + +-(void)sureAction +{ + //RuiMeiCHNameCustom 本地处理 保存按钮名称 不与服务器交互 + RuiMeiCHControl *ruSunch = [[RuiMeiCHControl alloc] init]; + RuSunChangeNameTextViewCell*cell1 = [self.view viewWithTag:RUSUNCHCELL_CH1]; + if (cell1.chName.text.length>3) { + [self.view makeToast:@"灯1不能超过3个字"]; + return; + } + if (cell1.chName.text.length==0) { + [self.view makeToast:@"灯1不能为空"]; + return; + } + + ruSunch.ch1name = cell1.chName.text; + RuSunChangeNameTextViewCell*cell2 = [self.view viewWithTag:RUSUNCHCELL_CH2]; + if (cell2.chName.text.length>3) { + [self.view makeToast:@"S2不能超过3个字"]; + return; + } + if (cell2.chName.text.length==0) { + [self.view makeToast:@"S2不能为空"]; + return; + } + + ruSunch.ch2name = cell2.chName.text; + RuSunChangeNameTextViewCell*cell3 = [self.view viewWithTag:RUSUNCHCELL_CH3]; + if (cell3.chName.text.length>3) { + [self.view makeToast:@"UV/杀菌不能超过3个字"]; + return; + } + if (cell3.chName.text.length==0) { + [self.view makeToast:@"UV/杀菌不能为空"]; + return; + } + + ruSunch.ch3name = cell3.chName.text; + RuSunChangeNameTextViewCell*cell4 = [self.view viewWithTag:RUSUNCHCELL_CH4]; + if (cell4.chName.text.length>3) { + [self.view makeToast:@"冲浪/氧泵不能超过3个字"]; + return; + } + if (cell4.chName.text.length==0) { + [self.view makeToast:@"冲浪/氧泵不能为空"]; + return; + } + ruSunch.ch4name = cell4.chName.text; + + RuSunChangeNameTextViewCell*cell5 = [self.view viewWithTag:RUSUNCHCELL_JIARE]; + if (cell5.chName.text.length>3) { + [self.view makeToast:@"加热棒名不能超过3个字"]; + return; + } + if (cell5.chName.text.length==0) { + [self.view makeToast:@"加热棒名不能为空"]; + return; + } + ruSunch.jiaRe = cell5.chName.text; + + ruSunch.macAd = self.device.macAddress; + + [RuiMeiCHNameCustom saveCHname:ruSunch]; + + [self upLoadDeviceName]; + +} + +@end diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiProtocolModel.h b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiProtocolModel.h new file mode 100644 index 0000000..ad09e19 --- /dev/null +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiProtocolModel.h @@ -0,0 +1,37 @@ +// +// RuiMeiProtocolModel.h +// Ifish +// +// Created by Minghao Xue on 2018/4/14. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import + +@interface RuiMeiProtocolModel : NSObject +@property (nonatomic,copy) NSString *ch1; +@property (nonatomic,copy) NSString *ch2; +@property (nonatomic,copy) NSString *ch3; +@property (nonatomic,copy) NSString *ch4; +@property (nonatomic,copy) NSString *customModel; + +@property(nonatomic,copy) NSString *timer1; +@property(nonatomic,copy) NSString *timer2; +@property(nonatomic,copy) NSString *timer3; +@property(nonatomic,copy) NSString *timer4; +@property(nonatomic,copy) NSString *timer5; +@property(nonatomic,copy) NSString *timer6; +@property(nonatomic,copy) NSString *timer7; +@property(nonatomic,copy) NSString *timer8; +@property(nonatomic,copy) NSString *heatStickState; +@property(nonatomic,copy) NSString *wendu; +// 加热温度 +@property(nonatomic,copy) NSString *heatTemperature; +//室温 +@property(nonatomic,copy) NSString *shiwen; +@property(nonatomic,copy) NSString *baojingSwitch; +@property(nonatomic,copy) NSString *miniTp; +@property(nonatomic,copy) NSString *maxTp; +@property(nonatomic,copy) NSString *funcCode; + +@end diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiProtocolModel.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiProtocolModel.m new file mode 100644 index 0000000..1373f5d --- /dev/null +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiProtocolModel.m @@ -0,0 +1,70 @@ +// +// RuiMeiProtocolModel.m +// Ifish +// +// Created by Minghao Xue on 2018/4/14. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import "RuiMeiProtocolModel.h" + +@implementation RuiMeiProtocolModel + +- (void)encodeWithCoder:(NSCoder *)aCoder { + [aCoder encodeObject:self.ch1 forKey:@"ch1"]; + [aCoder encodeObject:self.ch2 forKey:@"ch2"]; + [aCoder encodeObject:self.ch3 forKey:@"ch3"]; + [aCoder encodeObject:self.ch4 forKey:@"ch4"]; + [aCoder encodeObject:self.customModel forKey:@"customModel"]; + + [aCoder encodeObject:self.timer1 forKey:@"timer1"]; + [aCoder encodeObject:self.timer2 forKey:@"timer2"]; + [aCoder encodeObject:self.timer3 forKey:@"timer3"]; + [aCoder encodeObject:self.timer4 forKey:@"timer4"]; + [aCoder encodeObject:self.timer5 forKey:@"timer5"]; + [aCoder encodeObject:self.timer6 forKey:@"timer6"]; + [aCoder encodeObject:self.timer7 forKey:@"timer7"]; + [aCoder encodeObject:self.timer8 forKey:@"timer8"]; + [aCoder encodeObject:self.heatStickState forKey:@"heatStickState"]; + [aCoder encodeObject:self.wendu forKey:@"wendu"]; + [aCoder encodeObject:self.heatTemperature forKey:@"heatTemperature"]; + + [aCoder encodeObject:self.shiwen forKey:@"shiwen"]; + [aCoder encodeObject:self.baojingSwitch forKey:@"baojingSwitch"]; + [aCoder encodeObject:self.miniTp forKey:@"miniTp"]; + [aCoder encodeObject:self.maxTp forKey:@"maxTp"]; + [aCoder encodeObject:self.funcCode forKey:@"funcCode"]; +} + +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + if (self = [super init]) { + self.ch1 = [aDecoder decodeObjectForKey:@"ch1"]; + self.ch2 = [aDecoder decodeObjectForKey:@"ch2"]; + self.ch3 = [aDecoder decodeObjectForKey:@"ch3"]; + self.ch4 = [aDecoder decodeObjectForKey:@"ch4"]; + self.customModel = [aDecoder decodeObjectForKey:@"customModel"]; + + self.timer1 = [aDecoder decodeObjectForKey:@"timer1"]; + self.timer2 = [aDecoder decodeObjectForKey:@"timer2"]; + self.timer3 = [aDecoder decodeObjectForKey:@"timer3"]; + self.timer4 = [aDecoder decodeObjectForKey:@"timer4"]; + self.timer5 = [aDecoder decodeObjectForKey:@"timer5"]; + self.timer6 = [aDecoder decodeObjectForKey:@"timer6"]; + self.timer7 = [aDecoder decodeObjectForKey:@"timer7"]; + self.timer8 = [aDecoder decodeObjectForKey:@"timer8"]; + self.heatStickState = [aDecoder decodeObjectForKey:@"heatStickState"]; + self.wendu = [aDecoder decodeObjectForKey:@"wendu"]; + + self.heatTemperature = [aDecoder decodeObjectForKey:@"heatTemperature"]; + + self.shiwen = [aDecoder decodeObjectForKey:@"shiwen"]; + self.baojingSwitch = [aDecoder decodeObjectForKey:@"baojingSwitch"]; + self.miniTp = [aDecoder decodeObjectForKey:@"miniTp"]; + self.maxTp = [aDecoder decodeObjectForKey:@"maxTp"]; + self.funcCode = [aDecoder decodeObjectForKey:@"funcCode"]; + } + return self; +} + +@end + diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiSetViewController.h b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiSetViewController.h new file mode 100644 index 0000000..f62277e --- /dev/null +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiSetViewController.h @@ -0,0 +1,28 @@ +// +// RuiMeiSetViewController.h +// Ifish +// +// Created by Minghao Xue on 2018/4/22. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import "FatherController.h" + +@interface RuiMeiSetViewController : FatherController +{ + BOOL _isHidden; + BOOL mySwitchIsOn; + +} + +@property(nonatomic,strong)NSArray*timeArr; +@property(nonatomic,strong)NSArray*titleArr; +@property(nonatomic)BOOL isAuto;// 自动模式 + +@property(nonatomic)UIActivityIndicatorView*indicatorView; + +@property(nonatomic)int percent; +@property(nonatomic,strong) DeviceModel* currentdevice; +@property (nonatomic, assign) BOOL customModeOn; + +@end diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiSetViewController.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiSetViewController.m new file mode 100644 index 0000000..30bd52a --- /dev/null +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuiMei/RuiMeiSetViewController.m @@ -0,0 +1,1163 @@ +// +// RuiMeiSetViewController.m +// Ifish +// +// Created by Minghao Xue on 2018/4/22. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import "SetTimeCell.h" +#import "SecondSetTimeCell.h" +#import "SetTimeModel.h" +#import "SetSelectorTime.h" +//#import "AsyncSocket.h" +#import "setWaringTpModel.h" +#import "appLogin.h" +#import "workTypeModel.h" +#import "SetSelectorTime.h" +#define TIME_TAG 300 +#import "MyPickerView.h" +#import "searchDeviceModel.h" +#import "BackmassegeModel.h" +#import "MydatePickerView.h" +#define SET_CELL_TAG 2000 +#define MYSWITCH_TAG 30000 +#import "CenterViewController.h" +#import "TimerSateModel.h" +#import "TemperatureSetCell.h" +#import "TemperatureSetModel.h" +#import "AppDelegate.h" +#import "BrightnessCell.h" +#import "GuidengKaiGuanModel.h" +#import "GuiDengViewCell.h" +#import "ChangeWaterCell.h" +#import "remindCyclePic.h" +#import "BrightnessModel.h" +#import "RuiMeiProtocolModel.h" +#import "RuiMeiBackMsgUtils.h" +#import "RuSunGuiDeng.h" +#import "RuiMeiSetViewController.h" +#import "CustomModeSetCell.h" +#import "RuSunLightOrder.h" + +@interface RuiMeiSetViewController () +{ + + MydatePickerView*_mydatepicView; + MyPickerView* _mypicView; + remindCyclePic*_remindPic; + dispatch_queue_t _mainQueue; +} + +@property(nonatomic,strong)NSIndexPath*indexpath; + +@property(nonatomic,copy)NSString*statString; + +@property(nonatomic,copy)NSString*endString; + +@property(nonatomic,strong)UIView*lodingbackView; + +@property(nonatomic,copy)NSString*nextChangeDateLabel; + +@property(nonatomic,strong)setRemindWaterModel*waterInfmodel; + +@property(nonatomic) NSInteger tian; + +@end + +@implementation RuiMeiSetViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + + _waterInfmodel=[[setRemindWaterModel alloc]init]; + [super viewDidLoad]; + _mainQueue = dispatch_get_main_queue(); + self.navigationController.navigationBar.backItem.title=@""; + [self addTitleViewWithTitle:@"设置"]; + [self initData]; + + [self creatIndicatorView]; + + self.tableView.backgroundColor=COLOR_MIAN; + self.tableView.separatorStyle=UITableViewCellSeparatorStyleNone; +} + +-(void)creatIndicatorView{ + + _indicatorView=[[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; + + + _indicatorView.frame=CGRectMake(kScreenSize.width/2-50,kScreenSize.height/2-100,100, 100); + _indicatorView.backgroundColor=IndicatorBack_COLOR; + _indicatorView.layer.masksToBounds=YES; + _indicatorView.layer.cornerRadius=5; + AppDelegate*delegate=(AppDelegate*)[[UIApplication sharedApplication]delegate]; + [delegate.window addSubview:_indicatorView]; + +} + + +-(void)initData{ + + self.titleArr=@[@[@"预警设置",@"换水提醒",@"自定义模式开关"],@[@"时段一",@"时段二"],@[@"时段一",@"时段二"],@[@"时段一",@"时段二"],@[@"时段一",@"时段二"]]; + + + RuiMeiProtocolModel*backmodel=[[DataCenter defaultDtacenter]valueForKey:DataCenterRuiMeiModelKey]; + if (backmodel) { + NSString*low=backmodel.miniTp; + NSString*heigh=backmodel.maxTp; + UInt64 lowten=[dataContorl hexToTen:low]; + UInt64 heighten=[dataContorl hexToTen:heigh]; + float formatlow=lowten/10; + float formatheigh=heighten/10; + + NSString*wenduString=[NSString stringWithFormat:@"%.0f~%.0f°C",formatlow,formatheigh]; + //共八定时器 一个灯两个定时器 + //CH1 timer1 timer2 + // 十六进制 + NSString*startTimeHex1=[backmodel.timer1 substringWithRange:NSMakeRange(4, 4)]; + NSString*endTimeHex1=[backmodel.timer1 substringWithRange:NSMakeRange(8, 4)]; + + // 十进制 + NSString*startTimeTen1=[dataContorl hexStringToDateString:startTimeHex1]; + NSString*endTimeTen1=[dataContorl hexStringToDateString:endTimeHex1]; + NSString*setTim1=[NSString stringWithFormat:@"%@~%@",startTimeTen1,endTimeTen1]; + + NSString*startTimeHex2=[backmodel.timer2 substringWithRange:NSMakeRange(4, 4)]; + NSString*endTimeHex2=[backmodel.timer2 substringWithRange:NSMakeRange(8, 4)]; + NSString*startTimeTen2=[dataContorl hexStringToDateString:startTimeHex2]; + NSString*endTimeTen2=[dataContorl hexStringToDateString:endTimeHex2]; + NSString*setTim2=[NSString stringWithFormat:@"%@~%@",startTimeTen2,endTimeTen2]; + + //CH2 timer3 timer4 + // 十六进制 + NSString*startTimeHex3=[backmodel.timer3 substringWithRange:NSMakeRange(4, 4)]; + NSString*endTimeHex3=[backmodel.timer3 substringWithRange:NSMakeRange(8, 4)]; + NSString*startTimeTen3=[dataContorl hexStringToDateString:startTimeHex3]; + NSString*endTimeTen3=[dataContorl hexStringToDateString:endTimeHex3]; + NSString*setTim3=[NSString stringWithFormat:@"%@~%@",startTimeTen3,endTimeTen3]; + + + NSString*startTimeHex4=[backmodel.timer4 substringWithRange:NSMakeRange(4, 4)]; + NSString*endTimeHex4=[backmodel.timer4 substringWithRange:NSMakeRange(8, 4)]; + NSString*startTimeTen4=[dataContorl hexStringToDateString:startTimeHex4]; + NSString*endTimeTen4=[dataContorl hexStringToDateString:endTimeHex4]; + NSString*setTim4=[NSString stringWithFormat:@"%@~%@",startTimeTen4,endTimeTen4]; + + //CH3 timer5 timer6 + NSString*startTimeHex5=[backmodel.timer5 substringWithRange:NSMakeRange(4, 4)]; + NSString*endTimeHex5=[backmodel.timer5 substringWithRange:NSMakeRange(8, 4)]; + + NSString*startTimeTen5=[dataContorl hexStringToDateString:startTimeHex5]; + NSString*endTimeTen5=[dataContorl hexStringToDateString:endTimeHex5]; + NSString*setTim5=[NSString stringWithFormat:@"%@~%@",startTimeTen5,endTimeTen5]; + + + NSString*startTimeHex6=[backmodel.timer6 substringWithRange:NSMakeRange(4, 4)]; + NSString*endTimeHex6=[backmodel.timer6 substringWithRange:NSMakeRange(8, 4)]; + NSString*startTimeTen6=[dataContorl hexStringToDateString:startTimeHex6]; + NSString*endTimeTen6=[dataContorl hexStringToDateString:endTimeHex6]; + NSString*setTim6=[NSString stringWithFormat:@"%@~%@",startTimeTen6,endTimeTen6]; + //CH4 timer7 timer8 + + NSString*startTimeHex7=[backmodel.timer7 substringWithRange:NSMakeRange(4, 4)]; + NSString*endTimeHex7=[backmodel.timer7 substringWithRange:NSMakeRange(8, 4)]; + + NSString*startTimeTen7=[dataContorl hexStringToDateString:startTimeHex7]; + NSString*endTimeTen7=[dataContorl hexStringToDateString:endTimeHex7]; + NSString*setTim7=[NSString stringWithFormat:@"%@~%@",startTimeTen7,endTimeTen7]; + + + NSString*startTimeHex8=[backmodel.timer8 substringWithRange:NSMakeRange(4, 4)]; + NSString*endTimeHex8=[backmodel.timer8 substringWithRange:NSMakeRange(8, 4)]; + NSString*startTimeTen8=[dataContorl hexStringToDateString:startTimeHex8]; + NSString*endTimeTen8=[dataContorl hexStringToDateString:endTimeHex8]; + NSString*setTim8=[NSString stringWithFormat:@"%@~%@",startTimeTen8,endTimeTen8]; + + self.timeArr=@[@[wenduString,@"设置时段"],@[setTim1,setTim2],@[setTim3,setTim4],@[setTim5,setTim6],@[setTim7,setTim8,@""]]; + + }else{ + + [self.view makeToast:@"设备已离线"]; + self.timeArr=@[@[@"20~30°C",@"2:00~5:00"],@[@"2:00~5:00",@"2:00~5:00"],@[@"2:00~5:00",@"2:00~5:00"],@[@"2:00~5:00",@"2:00~5:00"],@[@"2:00~5:00",@"2:00~5:00",@""]]; + + } +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + + return 5; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + if (section == 0) { + return 3; + + }else if (section == 4){ + + return 3; + + }else{ + return 2; + } + +} + + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + + RuiMeiProtocolModel*backmodel=[[DataCenter defaultDtacenter]valueForKey:DataCenterRuiMeiModelKey]; + static NSString *cellID=@"kongCell"; + UITableViewCell *kongCell=[tableView dequeueReusableCellWithIdentifier:cellID]; + + if (kongCell==nil) { + + kongCell=[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellID]; + } + + + if (indexPath.section==0&&indexPath.row==0){ + TemperatureSetCell*cell=[tableView dequeueReusableCellWithIdentifier:@"TemperatureSetCell"]; + if (cell==nil) { + cell=[[[NSBundle mainBundle]loadNibNamed:@"TemperatureSetCell" owner:self options:nil]lastObject]; + } + cell.tag=indexPath.row +SET_CELL_TAG+indexPath.section*10; + TemperatureSetModel*model=[[TemperatureSetModel alloc]init]; + model.title=self.titleArr[indexPath.section][indexPath.row]; + + cell.titleLabel.text=model.title; + model.temperatureLabel=self.timeArr[indexPath.section][indexPath.row]; + cell.temperaturelabel.text=model.temperatureLabel; + [cell.temPSwitch addTarget:self action:@selector(ruSunTempSwitchAction:) forControlEvents:UIControlEventTouchUpInside]; + if (backmodel) { + if ([backmodel.baojingSwitch isEqualToString:@"01"]) { + + [cell.temPSwitch setBackgroundImage:[UIImage imageNamed:@"greenbtn_big"] forState:UIControlStateNormal]; + cell.temPSwitch.selected = NO; + + }else{ + + [cell.temPSwitch setBackgroundImage:[UIImage imageNamed:@"graybtn_big"] forState:UIControlStateNormal]; + + cell.temPSwitch.selected = YES; + } + + }else{ + + } + + return cell; + + }else if (indexPath.section==0&&indexPath.row==1){ + // 换水提醒 + if (![self.currentdevice.waterRemind isEqual:[NSNull null]]) { + ChangeWaterCell*cell=[tableView dequeueReusableCellWithIdentifier:@"ChangeWaterCell"]; + if (cell==nil) { + cell=[[[NSBundle mainBundle]loadNibNamed:@"ChangeWaterCell" owner:self options:nil]lastObject]; + } + + [cell.ChangeWaterSwitch addTarget:self action:@selector(ruSunChangeWaterSwitch:) forControlEvents:UIControlEventTouchUpInside]; + + if ([self.waterInfmodel.waterremind isEqualToString:@"1"]) { + [cell.ChangeWaterSwitch setBackgroundImage:[UIImage imageNamed:@"greenbtn_big"] forState:UIControlStateNormal]; + cell.ChangeWaterSwitch.selected = NO; + + + + cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"set_cellBack"]]; + }else{ + [cell.ChangeWaterSwitch setBackgroundImage:[UIImage imageNamed:@"graybtn_big"] forState:UIControlStateNormal]; + cell.ChangeWaterSwitch.selected = YES; + + cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"set_cellBack"]]; + } + + + if (self.waterInfmodel.remindcycle == 0) { + //在未获取换水信息时暂时显示 + cell.huanshuiDaylabel.text=@"换水时间"; + }else{ + + cell.huanshuiDaylabel.text=[NSString stringWithFormat:@"%ld天",(long)self.waterInfmodel.remindcycle]; + NSLog(@"ce;;%@",cell.huanshuiDaylabel.text); + + NSLog(@"222"); + } + + + return cell; + + }else{ + + kongCell.textLabel.text =@"错误信息 waterRemind null"; + return kongCell; + + } + + + }else if (indexPath.section==0&&indexPath.row==2){ + static NSString*customModeSetCellId=@"customModeSetCell"; + CustomModeSetCell*cell=[tableView dequeueReusableCellWithIdentifier:customModeSetCellId]; + if (cell==nil) { + cell=[[[NSBundle mainBundle]loadNibNamed:@"CustomModeSetCell" owner:self options:nil]lastObject]; + } + cell.switchControl.selected = self.customModeOn; + [cell.switchControl addTarget:self action:@selector(customModeSwitchBtnClicked:) forControlEvents:UIControlEventTouchUpInside]; + return cell; + + }else{ + + if (indexPath.section==4&&indexPath.row==2) { + //最后插入一个cell达到 椭圆底效果 + static NSString*cellId=@"lastSectlastcell"; + UITableViewCell*cell=[tableView dequeueReusableCellWithIdentifier:cellId]; + if (cell==nil) { + cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellId]; + } + cell.backgroundView =[ [UIImageView alloc] initWithImage:[UIImage imageNamed:@"secondSetCell"]]; + cell.userInteractionEnabled = NO; + + return cell; + + }else{ + + SetTimeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SetTimeCell"]; + if (cell==nil) { + cell=[[[NSBundle mainBundle]loadNibNamed:@"SetTimeCell" owner:self options:nil]lastObject]; + } + + SetTimeModel*model=[[SetTimeModel alloc]init]; + model.title=self.titleArr[indexPath.section][indexPath.row]; + cell.titleLabel.text=model.title; + model.timestring=self.timeArr[indexPath.section][indexPath.row]; + cell.timeLabel.text=model.timestring; + cell.timeLabel.tag=TIME_TAG+indexPath.section*10+indexPath.row; + + + if (indexPath.section!=0 && !(indexPath.section==4&&indexPath.row==2)) { + + cell.tag=indexPath.row +SET_CELL_TAG+indexPath.section*10; + cell.mySwitchButton.tag=indexPath.row +MYSWITCH_TAG+indexPath.section*10; + + } + + if (indexPath.section!=0 && !(indexPath.section==4&&indexPath.row==2)) { + + + if (indexPath.section==1&&indexPath.row==0) {//开关一 + NSString*state=[backmodel.timer1 substringWithRange:NSMakeRange(2, 2)]; + + if ([state isEqualToString:@"00"]) { + + [cell.mySwitchButton setImage:[UIImage imageNamed:@"Switch-Off"] forState:UIControlStateNormal]; + + + }else{ + + [cell.mySwitchButton setImage:[UIImage imageNamed:@"Switch-On"] forState:UIControlStateNormal]; + } + } + + if (indexPath.section==1&&indexPath.row==1) {//开关2 + NSString*state=[backmodel.timer2 substringWithRange:NSMakeRange(2, 2)]; + if ([state isEqualToString:@"00"]) { + + [cell.mySwitchButton setImage:[UIImage imageNamed:@"Switch-Off"] forState:UIControlStateNormal]; + + }else{ + + [cell.mySwitchButton setImage:[UIImage imageNamed:@"Switch-On"] forState:UIControlStateNormal]; + } + } + if (indexPath.section==2&&indexPath.row==0) {//开关3 + NSString*state=[backmodel.timer3 substringWithRange:NSMakeRange(2, 2)]; + if ([state isEqualToString:@"00"]) { + + [cell.mySwitchButton setImage:[UIImage imageNamed:@"Switch-Off"] forState:UIControlStateNormal]; + + }else{ + + [cell.mySwitchButton setImage:[UIImage imageNamed:@"Switch-On"] forState:UIControlStateNormal]; + } + } + + if (indexPath.section==2&&indexPath.row==1) {//开关4 + NSString*state=[backmodel.timer4 substringWithRange:NSMakeRange(2, 2)]; + + if ([state isEqualToString:@"00"]) { + + [cell.mySwitchButton setImage:[UIImage imageNamed:@"Switch-Off"] forState:UIControlStateNormal]; + + }else{ + + [cell.mySwitchButton setImage:[UIImage imageNamed:@"Switch-On"] forState:UIControlStateNormal]; + } + } + + if (indexPath.section==3&&indexPath.row==0) {//开关5 + NSString*state=[backmodel.timer5 substringWithRange:NSMakeRange(2, 2)]; + NSLog(@"state5****%@",state); + if ([state isEqualToString:@"00"]) { + + [cell.mySwitchButton setImage:[UIImage imageNamed:@"Switch-Off"] forState:UIControlStateNormal]; + + }else{ + + + [cell.mySwitchButton setImage:[UIImage imageNamed:@"Switch-On"] forState:UIControlStateNormal]; + } + } + + if (indexPath.section==3&&indexPath.row==1) {//开关6 + NSString*state=[backmodel.timer6 substringWithRange:NSMakeRange(2, 2)]; + NSLog(@"state6****%@",state); + if ([state isEqualToString:@"00"]) { + + [cell.mySwitchButton setImage:[UIImage imageNamed:@"Switch-Off"] forState:UIControlStateNormal]; + + + }else{ + + [cell.mySwitchButton setImage:[UIImage imageNamed:@"Switch-On"] forState:UIControlStateNormal]; + + } + } + + if (indexPath.section==4&&indexPath.row==0) {//开关7 + NSString*state=[backmodel.timer7 substringWithRange:NSMakeRange(2, 2)]; + NSLog(@"state7****%@",state); + if ([state isEqualToString:@"00"]) { + + [cell.mySwitchButton setImage:[UIImage imageNamed:@"Switch-Off"] forState:UIControlStateNormal]; + + }else{ + + [cell.mySwitchButton setImage:[UIImage imageNamed:@"Switch-On"] forState:UIControlStateNormal]; + } + } + + if (indexPath.section==4&&indexPath.row==1) {//开关8 + + NSString*state=[backmodel.timer8 substringWithRange:NSMakeRange(2, 2)]; + NSLog(@"state8****%@",state); + if ([state isEqualToString:@"00"]) { + + [cell.mySwitchButton setImage:[UIImage imageNamed:@"Switch-Off"] forState:UIControlStateNormal]; + + }else{ + + [cell.mySwitchButton setImage:[UIImage imageNamed:@"Switch-On"] forState:UIControlStateNormal]; + } + } + + } + + [cell setRuSunControl84biteAtIndex:indexPath currenmac:self.currentdevice.macAddress]; + //cell 选中效果 + [cell.mySwitchButton addTarget:self action:@selector(btnCliCk:) forControlEvents:UIControlEventTouchUpInside]; + + return cell; + + + } + } + +} + +-(void)btnCliCk:(UIButton*)btn{ + + if (!self.customModeOn) { + return; + } + + TimerSateModel*stateModel=[[TimerSateModel alloc]init]; + stateModel.sendmacId = self.currentdevice.macAddress; + stateModel.resavemacId =self.currentdevice.macAddress; + + + stateModel.crc16String=@"0000"; + RuiMeiProtocolModel*backmodel=[[DataCenter defaultDtacenter]valueForKey:DataCenterRuiMeiModelKey]; + + NSString*backState=nil; + + if (btn.tag==30010) { + backState=[backmodel.timer1 substringWithRange:NSMakeRange(2, 2)]; + + stateModel.timerNumber=@"01"; + + }else if (btn.tag==30011){ + backState=[backmodel.timer2 substringWithRange:NSMakeRange(2, 2)]; + + stateModel.timerNumber=@"02"; + // stateModel.timerState=[backmodel.timer2 substringWithRange:NSMakeRange(2, 2)]; + + }else if (btn.tag==30020){ + + backState=[backmodel.timer3 substringWithRange:NSMakeRange(2, 2)]; + + stateModel.timerNumber=@"03"; + // stateModel.timerState=[backmodel.timer3 substringWithRange:NSMakeRange(2, 2)]; + }else if (btn.tag==30021){ + backState=[backmodel.timer4 substringWithRange:NSMakeRange(2, 2)]; + + stateModel.timerNumber=@"04"; + // stateModel.timerState=[backmodel.timer4 substringWithRange:NSMakeRange(2, 2)]; + + }else if (btn.tag==30030){ + backState=[backmodel.timer5 substringWithRange:NSMakeRange(2, 2)]; + + stateModel.timerNumber=@"05"; + //stateModel.timerState=[backmodel.timer5 substringWithRange:NSMakeRange(2, 2)]; + + + }else if (btn.tag==30031){ + backState=[backmodel.timer6 substringWithRange:NSMakeRange(2, 2)]; + + stateModel.timerNumber=@"06"; + + }else if (btn.tag==30040){ + + backState=[backmodel.timer7 substringWithRange:NSMakeRange(2, 2)]; + + stateModel.timerNumber=@"07"; + }else if (btn.tag==30041){ + + backState=[backmodel.timer8 substringWithRange:NSMakeRange(2, 2)]; + + stateModel.timerNumber=@"08"; + } + + if ([backState isEqualToString:@"01"]) { + //发关闭指令 + stateModel.timerState=@"00";// 关 + NSString*stateString=[NSString stringWithFormat:@"%@%@%@%@",stateModel.description,stateModel.timerNumber,stateModel.timerState,stateModel.crc16String]; + + NSData*selctorData=[dataContorl stringToHexData:stateString]; + [[Socketsingleton sharedInstance] soketWriteData:selctorData]; + [_indicatorView startAnimating]; + [btn setImage:[UIImage imageNamed:@"Switch-Off"] forState:UIControlStateNormal]; + + }else{ + //发打开指令 + stateModel.timerState=@"01";// 开 + NSString*selectorString=[NSString stringWithFormat:@"%@%@%@%@",stateModel.description,stateModel.timerNumber,stateModel.timerState,stateModel.crc16String]; + + NSData*selctorData=[dataContorl stringToHexData:selectorString]; + [[Socketsingleton sharedInstance] soketWriteData:selctorData]; + [_indicatorView startAnimating]; + [btn setImage:[UIImage imageNamed:@"Switch-On"] forState:UIControlStateNormal]; + } + +} + +#pragma mark 开启关闭报警 +-(void)ruSunTempSwitchAction:(UIButton*)temperatureSwitch{ + + RuiMeiProtocolModel*backmodel=[[DataCenter defaultDtacenter]valueForKey:DataCenterRuiMeiModelKey]; + setWaringTpModel*warModel1=[[setWaringTpModel alloc]init]; + warModel1.sendmacId =self.currentdevice.macAddress; + warModel1.resavemacId = self.currentdevice.macAddress; + + //BOOL isOn=[temperatureSwitch isOn]; + if (temperatureSwitch.selected == YES) { + NSLog(@"开"); + temperatureSwitch.selected = NO; + warModel1.kaiguan=@"01";// 开 + warModel1.miniwaterTp=@"0000"; // 0 + warModel1.maxwaterTp=@"0000";//0 + }else{ + temperatureSwitch.selected =YES; + + warModel1.kaiguan=@"00";// 关 + warModel1.miniwaterTp=@"0000"; // 0 + warModel1.maxwaterTp=@"0000";//0 + NSLog(@"关"); + } + [self setTmperatureStateWithModel:warModel1 addBackModel:backmodel]; + +} +-(void)setTmperatureStateWithModel:(setWaringTpModel*)waringModel addBackModel:(RuiMeiProtocolModel *)backModel{ + NSString*maxminTpString=waringModel.description; + waringModel.crc16Ing=@"0000"; + NSString*minString=[NSString stringWithFormat:@"%@%@%@%@%@",maxminTpString,waringModel.kaiguan,waringModel.miniwaterTp,waringModel.maxwaterTp,waringModel.crc16Ing]; + NSData*minwenDuData=[dataContorl stringToHexData:minString]; + [[Socketsingleton sharedInstance] soketWriteData:minwenDuData]; + [_indicatorView startAnimating]; + backModel.miniTp=waringModel.miniwaterTp; + backModel.maxTp=waringModel.maxwaterTp; + +} + +#pragma mark 换水提醒Action +-(void)ruSunChangeWaterSwitch:(UIButton*)sender{ + + UIButton*huanShuiSwitch=(UIButton*)sender; + + //BOOL isButtonOn=[huanShuiSwitch isOn]; + + NSUserDefaults*defuat=[NSUserDefaults standardUserDefaults]; + NSString*picResult=[defuat valueForKey:@"RuiMei2aPicResult"]; + int pic = picResult.intValue; + if (pic==0) { + [self showTitle:@"" messsage:@"请设置提醒天数"]; + if (huanShuiSwitch.selected == YES) { + huanShuiSwitch.selected =NO; + + }else{ + huanShuiSwitch.selected =YES; + } + + }else{ + + if (huanShuiSwitch.selected ==YES) { + //开 + huanShuiSwitch.selected =NO; + [IFISHHTTPTOOL setRemindWaterInfWith:self.currentdevice.deviceId + waterRemind:@"1" remindCycle:picResult + huishuiShiJian:^(setRemindWaterModel *remindModel) { + self.nextChangeDateLabel=remindModel.remindDate; + + }]; + //更新选择状态 设置界面 在不断 刷新 + + self.waterInfmodel.waterremind=@"1"; + [self.tableView reloadData]; + + }else{ + //关 + huanShuiSwitch.selected =YES; + [IFISHHTTPTOOL setRemindWaterInfWith:self.currentdevice.deviceId + waterRemind:@"0" remindCycle:picResult + huishuiShiJian:^(setRemindWaterModel *remindModel) { + + self.nextChangeDateLabel=remindModel.remindDate; + self.waterInfmodel=remindModel; + + }]; + + self.waterInfmodel.waterremind=@"0"; + + [self.tableView reloadData]; + + } + } +} + +#pragma mark - 自定义模式开关设置 +-(void)customModeSwitchBtnClicked:(UIButton*)sender{ + //此款设备无运行模式 + RuSunLightOrder*lightOrder=[[RuSunLightOrder alloc]init]; + lightOrder.sendmacId = self.currentdevice.macAddress; + lightOrder.resavemacId = self.currentdevice.macAddress; + NSString*switchString1=lightOrder.description; + + NSString *lightSate; + if (sender.selected == YES) { + sender.selected = NO; + lightSate=@"00"; + }else{ + sender.selected =YES; + lightSate=@"01";// 关 + } + lightOrder.switchBtn = lightSate; + lightOrder.crc16Str=@"0000"; + lightOrder.lightNumber=@"05"; + NSString*switchString2=[NSString stringWithFormat:@"%@%@%@%@",switchString1,lightOrder.lightNumber,lightOrder.switchBtn,lightOrder.crc16Str]; + NSData*manulData=[dataContorl stringToHexData:switchString2]; + [ [Socketsingleton sharedInstance] soketWriteData:manulData]; + [_indicatorView startAnimating]; +} + +#pragma mark tableView 头视图和脚视图 +-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ + + + if (section == 1) { + return 50; + + }else if (section ==0){ + return 5; + }else { + return 0; + } + +} + +-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ + + if (indexPath.section==0&&indexPath.row==2) { + return 50; + + }else if (indexPath.section==0&&indexPath.row==1){ + + if (![_currentdevice.waterRemind isEqual:[NSNull null]]) { + + return 50; + + }else{ + + return 0; + } + + }else if (indexPath.section==0&&indexPath.row==0){ + //会否有 预警 + if (![_currentdevice.isPushWendu isEqual:[NSNull null]]) { + + if ([_currentdevice.isPushWendu isEqualToString:@"1"]) { + return 50; + }else{ + return 0; + } + + }else{ + + return 0; + } + + }else{ + + return 50; + } + +} + +-(UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{ + if (section==1) { + UIImageView*secondSectionHeader=[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"firstSetCell"]]; + UILabel *label=[[UILabel alloc] init]; + label.text=@"定时模式"; + label.font = [UIFont systemFontOfSize:15]; + label.frame=CGRectMake(18, 5, 100, 40); + [secondSectionHeader addSubview:label]; + + return secondSectionHeader; + + + }else if (section == 0){ + UIView*oneHeader=[[UIView alloc] init]; + oneHeader.backgroundColor=COLOR_MIAN; + return oneHeader; + + }else{ + return nil; + } + +} +#pragma mark tableView 点击事件 + +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ + _indexpath=indexPath; + if (indexPath.row==0&&indexPath.section==0) { + + _mypicView=[[MyPickerView alloc]init]; + + _mypicView.frame=CGRectMake(0, 0, kScreenSize.width, kScreenSize.height); + [self.view.window addSubview:_mypicView]; + [_mypicView.cancleButton addTarget:self action:@selector(mypicviewRemoveByCancle) forControlEvents:UIControlEventTouchUpInside]; + [_mypicView.sureButton addTarget:self action:@selector(mypicViewRemoveByDone) forControlEvents:UIControlEventTouchUpInside]; + [self temperatureMainQueue]; + + }else if (indexPath.section==0&&indexPath.row==1){ + //换水提醒日期选择 + _remindPic=[[remindCyclePic alloc]init]; + + _remindPic.frame=CGRectMake(0, 0, kScreenSize.width, kScreenSize.height); + [self.view.window addSubview:_remindPic]; + [_remindPic.cancleBtn addTarget:self action:@selector(xuToremindCyclePicRemove) forControlEvents:UIControlEventTouchUpInside]; + + [_remindPic.sureBtn addTarget:self action:@selector(xuToremindCyclePicDone) forControlEvents:UIControlEventTouchUpInside]; + + [self huanShuiMainQueue]; + + }else if (indexPath.section!=0){ + + if (!self.customModeOn) { + return; + } + + _mydatepicView=[[MydatePickerView alloc]init]; + + _mydatepicView.frame=CGRectMake(0,0,kScreenSize.width,kScreenSize.height); + + [_mydatepicView.cancleButton addTarget:self action:@selector(cancleButtonClick) forControlEvents:UIControlEventTouchUpInside]; + [_mydatepicView.sureButton addTarget:self action:@selector(doneButtonClick) forControlEvents:UIControlEventTouchUpInside]; + + RuiMeiProtocolModel*backmodel=[[DataCenter defaultDtacenter]valueForKey:DataCenterRuiMeiModelKey]; + if (backmodel) { + //在线 + [self useMainQueue]; + } + + + + // 设置pickerView 默认选择行 + + [self.view.window addSubview:_mydatepicView]; + + + } +} + +#pragma mark 移除换水时间选择器 + +-(void)xuToremindCyclePicRemove{ + + [_remindPic removeFromSuperview]; + +} + +#pragma mark 换水时间设置 + +-(void)xuToremindCyclePicDone{ + + if (_indexpath.section==0&&_indexpath.row==1) { + ChangeWaterCell*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]; + [_remindPic makeToast:@"请设置换水天数"]; + return; + } + + + cell.huanshuiDaylabel.text=[NSString stringWithFormat:@"%@天",str]; + //设置换水日期 + [IFISHHTTPTOOL setRemindWaterInfWith:self.currentdevice.deviceId + waterRemind:@"1" remindCycle:str + huishuiShiJian:^(setRemindWaterModel *remindModel) { + + self.nextChangeDateLabel=remindModel.remindDate; + self.waterInfmodel.waterremind=@"1"; + self.waterInfmodel.remindDate=remindModel.remindDate; + self.waterInfmodel.remindcycle = remindModel.remindcycle; + [self.tableView reloadData]; + + }]; + + NSUserDefaults*defuat=[NSUserDefaults standardUserDefaults]; + + [defuat setValue:str forKey:@"RuiMei2aPicResult"]; + + [defuat synchronize]; + + [_remindPic removeFromSuperview]; + + + } + +} + +#pragma mark 默认换水时间 +-(void)huanShuiMainQueue{ + + if (_remindPic.picViewResultString !=nil || (_remindPic.picViewResultString ==nil && self.waterInfmodel.remindcycle !=0 )) { + + + + NSArray*shijianArr=[_remindPic.picArr objectAtIndex:0]; + dispatch_async(_mainQueue, ^{ + NSLog(@"a"); + for (NSInteger k=0; k +{ + dispatch_queue_t _ruSunMainQueue; +} +@property(nonatomic,strong) RuiMeiProtocolModel *backmodel; +@property(nonatomic,strong) HaveHotCoolWenDuPicview *wenduPicview; +@property(nonatomic,strong) RuiMeiSetViewController *setVC; +//@property(nonatomic,strong) RunSunChangeNameViewController *changenameVC; +@property(nonatomic,strong) RuiMeiInputViewController *changenameVC; + +@end + +@implementation RuiMeiViewController + +- (void)viewDidLoad { + + [super viewDidLoad]; + + _backmodel=[[RuiMeiProtocolModel alloc] init]; + [Socketsingleton sharedInstance].communiteDelegate=self; + _ruSunMainQueue = dispatch_get_main_queue(); + // Do any additional setup after loading the view. + UITapGestureRecognizer*tapgestureRecognizer=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(RuSunCenterViewSetTap)]; + [self.setImag addGestureRecognizer:tapgestureRecognizer]; + [self.setbackBtn addTarget:self action:@selector(RuSunCenterViewSetAction:) forControlEvents:UIControlEventTouchUpInside]; + [self.SetTimeButton addTarget:self action:@selector(RuSunCenterViewSetAction:) forControlEvents:UIControlEventTouchUpInside]; + + [self initControlNormalBtn]; +} + +-(void)RuSunCenterViewSetTap +{ + + RuiMeiProtocolModel*backmodel=[[DataCenter defaultDtacenter]valueForKey:DataCenterRuiMeiModelKey]; + + if (backmodel) { + [self pushSetTimeVC]; + }else{ + [self deviceNotOnlineState]; + + [self showLableAction:@"设备已离线"]; + + [self.indicatorView stopAnimating]; + + } + + +} + +#pragma mark -转跳设置界面 + +-(void)RuSunCenterViewSetAction:(UIButton*)btn +{ + RuiMeiProtocolModel*backmodel=[[DataCenter defaultDtacenter]valueForKey:DataCenterRuiMeiModelKey]; + if (backmodel) { + [self pushSetTimeVC]; + }else{ + [self deviceNotOnlineState]; + + [self showLableAction:@"设备已离线"]; + + [self.indicatorView stopAnimating]; + + } + +} + +-(void)pushSetTimeVC{ + + self.setVC=[[RuiMeiSetViewController alloc]init]; + + self.setVC.currentdevice=self.currentDevice; + NSString*stateString=[self.backmodel.customModel substringWithRange:NSMakeRange(2, 2)]; + if ([stateString isEqualToString:@"01"]) { + self.setVC.customModeOn=YES; + }else{ + self.setVC.customModeOn=NO; + } + [self.navigationController pushViewController:self.setVC animated:YES]; + +} + + +-(void)initControlNormalBtn +{ + + NSArray*nameArr=@[@"PFLight1_off.png",@"PFLight1_off.png",@"PFkilLlight_off.png",@"O2_off.png",@"JiaReBang"]; + + CGFloat btnControlWith = 70; + CGFloat btnControlPlace = (kScreenSize.width - 3*btnControlWith )/4; + + for (int i = 0; i < 3; i ++) { + + self.button = [[UIButton alloc] init] ; + self.button.frame = CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith),kScreenSize.height - 3*btnControlPlace - 2 *btnControlWith -10 - 10 , btnControlWith, btnControlWith +11); + + [self.button setImage:[UIImage imageNamed:nameArr[i]] forState:UIControlStateNormal]; + //self.button.backgroundColor = [UIColor redColor]; + self.button.tag=6000+i; + [self.button addTarget:self action:@selector(controlBtnCilck:) forControlEvents:UIControlEventTouchUpInside]; + + + self.chName = [[UILabel alloc] initWithFrame:CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith),kScreenSize.height - 3*btnControlPlace - 2 *btnControlWith -20 + btnControlWith -5 , btnControlWith, btnControlPlace - 5)]; + //textLbl.backgroundColor = [UIColor blackColor]; + self.chName.textColor = [UIColor colorWithRed:250/255.0f green:255/255.0f blue:255/254.0f alpha:1]; + self.chName.textAlignment = NSTextAlignmentCenter; + NSArray *arr = @[@"灯1",@"灯2",@"UV/杀菌"]; + self.chName.text = arr[i]; + + self.chName.font = [UIFont boldSystemFontOfSize:14]; + + [self.tableView addSubview:self.chName]; + [self.tableView addSubview:self.button]; + + if (i==0) { + + self.ch1Button = self.button; + self.ch1Name = self.chName; + }else if (i==1){ + + self.ch2Button = self.button; + self.ch2Name = self.chName; + + }else if (i==2){ + self.ch3Name = self.chName; + self.ch3Button = self.button; + + } + + } + + //CGFloat btnControlPlace1 = (kScreenSize.width - 2*btnControlWith )/3; + + for (int i = 0; i < 2; i ++) { + self.button = [[UIButton alloc] init] ; + self.button.frame = CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith), kScreenSize.height - 2*btnControlPlace - btnControlWith -25 -5 , btnControlWith, btnControlWith + 11); + + + [self.button setImage:[UIImage imageNamed:nameArr[i+3]]forState:UIControlStateNormal]; + + self.button.tag= 6003+i; + [self.button addTarget:self action:@selector(controlBtnCilck:) forControlEvents:UIControlEventTouchUpInside]; + if (i == 1) { + UILabel *tempLbl = [UILabel new]; + [self.button addSubview:tempLbl]; + tempLbl.tag = 1; + tempLbl.font = [UIFont boldSystemFontOfSize:16]; + tempLbl.textColor = [UIColor lightGrayColor]; + tempLbl.textAlignment = NSTextAlignmentCenter; + tempLbl.translatesAutoresizingMaskIntoConstraints = NO; + [NSLayoutConstraint constraintWithItem:tempLbl attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.button attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:0.0].active = YES; + [NSLayoutConstraint constraintWithItem:tempLbl attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self.button attribute:NSLayoutAttributeCenterY multiplier:1.0 constant:-4.0].active = YES; + } + UILabel* textLbl = [[UILabel alloc] initWithFrame:CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith), kScreenSize.height - 2*btnControlPlace - btnControlWith -35 + btnControlWith, btnControlWith, btnControlPlace - 5)]; + //textLbl.backgroundColor = [UIColor blackColor]; + textLbl.textAlignment = NSTextAlignmentCenter; + textLbl.textColor = [UIColor colorWithRed:250/255.0f green:255/255.0f blue:255/254.0f alpha:1]; + NSArray *arr = @[@"冲浪/氧泵",@"加热棒"]; + textLbl.font = [UIFont boldSystemFontOfSize:14]; + textLbl.text = arr[i]; + self.chName = textLbl; + [self.tableView addSubview:textLbl]; + [self.tableView addSubview:self.button]; + + if (i==0) { + + self.ch4Button = self.button; + self.ch4Name = self.chName; + } else if (i==1){ + self.heatBtn = self.button; + self.jiaReName = self.chName; + + } + } + + //重置 self.bubble 的 frame + CGFloat animViewHeight= kScreenSize.width/4; + if (kScreenSize.height==480) { + + self.bubble.frame = CGRectMake((kScreenSize.width -(kScreenSize.width - 2 * kPlace)*2/3)/2, kPlace + 60 , (kScreenSize.width - 2 * kPlace)*2/3, (kScreenSize.width - 2 * kPlace)*2/3); + + //(kScreenSize.width - 2 * kPlace - 200)*2/3 + self.temperature.frame = CGRectMake(30, 70, (kScreenSize.width - 2 * kPlace - 100)*2/3, 50); + self.temperature.font = [UIFont fontWithName:@"Avenir Next Condensed" size:46]; + + self.dulabel.frame = CGRectMake( (kScreenSize.width - 2 * kPlace - 100)*2/3,74,50, kScreenSize.width - 2 * kPlace - 210); + + + self.dulabel.font = [UIFont fontWithName:@"Avenir Next Condensed" size:20]; + + self.animView.frame= CGRectMake(0, kPlace + 80 + (kScreenSize.width - 2 * kPlace) -animViewHeight/2 - 15-80, kScreenSize.width, animViewHeight); + + self.notOnLineLabel.frame = CGRectMake(40, 60, kScreenSize.width - 2 * kPlace - 100, kScreenSize.width - 2 * kPlace - 200); + self.notOnLineLabel .font = [UIFont fontWithName:@"Avenir Next Condensed" size:15]; + + self.hotcolLabe = [[UILabel alloc] init]; + self.hotcolLabe.frame = CGRectMake(0, CGRectGetMaxY(self.temperature.frame) + 10, self.bubble.frame.size.width, 15); + //self.hotcolLabe.textColor = JWUIColorFromRGB(fc6638); + self.hotcolLabe.textAlignment = NSTextAlignmentCenter; + self.hotcolLabe.font =[UIFont systemFontOfSize:13]; + self.hotcolLabe.text = @"制冷加热"; + [self.bubble addSubview:self.hotcolLabe]; + + self.hotcolTempLabe = [[UILabel alloc] init]; + self.hotcolTempLabe.frame = CGRectMake(0, CGRectGetMaxY(self.hotcolLabe.frame) + 5, self.bubble.frame.size.width, 15); + self.hotcolTempLabe.font =[UIFont systemFontOfSize:14]; + self.hotcolTempLabe.textAlignment = NSTextAlignmentCenter; + self.hotcolTempLabe.textColor = JWUIColorFromRGB(0x666666); + self.hotcolTempLabe.text = @"温度"; + [self.bubble addSubview:self.hotcolTempLabe]; + + + }else{ + //kScreenSize.width - 2 * kPlace - 200 + self.temperature.frame = CGRectMake(10, 80, kScreenSize.width - 2 * kPlace - 100,70); + self.temperature.font = [UIFont fontWithName:@"Avenir Next Condensed" size:60]; + + self.bubble.frame = CGRectMake((kScreenSize.width -(kScreenSize.width - 3 * kPlace ))/2, kPlace + 80 , kScreenSize.width - 3 * kPlace, kScreenSize.width - 3 * kPlace); + + self.dulabel.frame = CGRectMake((kScreenSize.width - 2 * kPlace)/3*2 -30 , 90 ,50, 60); + self.dulabel.font = [UIFont fontWithName:@"Avenir Next Condensed" size:40]; + self.animView.frame= CGRectMake(0, kPlace + 40 + (kScreenSize.width - 2 * kPlace) -animViewHeight/2 - 15, kScreenSize.width, animViewHeight); + + CGFloat bubH=kScreenSize.width - 3 * kPlace; + self.notOnLineLabel.frame = CGRectMake(0,bubH/2-15, bubH, 30); + self.notOnLineLabel .font = [UIFont fontWithName:@"Avenir Next Condensed" size:20]; + + self.hotcolLabe = [[UILabel alloc] init]; + self.hotcolLabe.frame = CGRectMake(0, CGRectGetMaxY(self.temperature.frame) + 10, self.bubble.frame.size.width, 15); + //self.hotcolLabe.textColor = JWUIColorFromRGB(fc6638); + self.hotcolLabe.textAlignment = NSTextAlignmentCenter; + self.hotcolLabe.font =[UIFont systemFontOfSize:13]; + [self.bubble addSubview:self.hotcolLabe]; + + self.hotcolTempLabe = [[UILabel alloc] init]; + self.hotcolTempLabe.frame = CGRectMake(0, CGRectGetMaxY(self.hotcolLabe.frame) + 5, self.bubble.frame.size.width, 15); + self.hotcolTempLabe.font =[UIFont systemFontOfSize:14]; + self.hotcolTempLabe.textAlignment = NSTextAlignmentCenter; + self.hotcolTempLabe.textColor = JWUIColorFromRGB(0x666666); + self.hotcolTempLabe.text = @"温度"; + [self.bubble addSubview:self.hotcolTempLabe]; + } + + [self initCHNames]; +} + + +#pragma mark - 控制按钮事件 + +-(void)controlBtnCilck:(UIButton *)btn{ + + RuiMeiProtocolModel*backmodel=[[DataCenter defaultDtacenter]valueForKey:DataCenterRuiMeiModelKey]; + if (backmodel) { + + + }else{ + [self.indicatorView stopAnimating]; + [self deviceNotOnlineState]; + [self showLableAction:@"设备已离线"]; + return; + } + + NSString *lightSate; + if (btn.selected) { + lightSate=@"00"; + btn.selected=NO; + + }else { + lightSate=@"01"; + btn.selected=YES; + } + + switch (btn.tag) { + + case RUNSUN_CH1: + { + btn.userInteractionEnabled=YES; + [btn setImage:[UIImage imageNamed:@"PFLight1_on.png"] forState:UIControlStateSelected]; + [self sendOffOnLinghtCommend:@"01" liaghtState:lightSate]; + + } + break; + + case RUNSUN_CH2: + { + btn.userInteractionEnabled=YES; + [btn setImage:[UIImage imageNamed:@"PFLight1_on.png"] forState:UIControlStateSelected]; + [self sendOffOnLinghtCommend:@"02" liaghtState:lightSate]; + } + break; + case RUNSUN_CH3: + { + btn.userInteractionEnabled=YES; + [btn setImage:[UIImage imageNamed:@"PFkilLlight_on.png"] forState:UIControlStateSelected]; + [self sendOffOnLinghtCommend:@"03" liaghtState:lightSate]; + } + break; + case RUNSUN_CH4: + { + btn.userInteractionEnabled=YES; + [btn setImage:[UIImage imageNamed:@"O2_on.png"] forState:UIControlStateSelected]; + [self sendOffOnLinghtCommend:@"04" liaghtState:lightSate]; + } + break; + case RUNSUN_JARE: + { + if (backmodel) { + _wenduPicview=[[HaveHotCoolWenDuPicview alloc] init]; + _wenduPicview.cateSwich.hidden = YES; + _wenduPicview.frame=CGRectMake(0, 0, kScreenSize.width, kScreenSize.height); + [_wenduPicview.sureBtn addTarget:self action:@selector(sureBtnClick:) forControlEvents:UIControlEventTouchUpInside]; + + [self.view.window addSubview:_wenduPicview]; + _wenduPicview.wenDuPicviewDelegate = self; + NSString *stateStr =nil; + if ([backmodel.heatStickState isKindOfClass:[NSNull class]]||!backmodel.heatStickState) { + backmodel.heatStickState = @"00"; + } + stateStr = [backmodel.heatStickState substringWithRange:NSMakeRange(0, 2)]; + [_wenduPicview initCateBtnSate:stateStr]; + + [self ruSunJiaReMianQue]; + + }else{ + + [self showLableAction:@"设备已离线"]; + } + + } + break; + default: + break; + } + +} + +#pragma mark - 发送开关灯指令 +-(void)sendOffOnLinghtCommend:(NSString *)linghtNumber liaghtState:(NSString *)state +{ + //此款设备无运行模式 + RuSunLightOrder*lightOrder=[[RuSunLightOrder alloc]init]; + lightOrder.sendmacId = self.currentDevice.macAddress; + lightOrder.resavemacId = self.currentDevice.macAddress; + NSString*switchString1=lightOrder.description; + lightOrder.switchBtn = state; + lightOrder.crc16Str=@"0000"; + lightOrder.lightNumber=linghtNumber; + NSString*switchString2=[NSString stringWithFormat:@"%@%@%@%@",switchString1,lightOrder.lightNumber,lightOrder.switchBtn,lightOrder.crc16Str]; + NSData*manulData=[dataContorl stringToHexData:switchString2]; + [ [Socketsingleton sharedInstance] soketWriteData:manulData]; + if ([Socketsingleton sharedInstance].clientSocket.isConnected) { + //soket 未断开时显示 + [self initHUD]; + [self.myhud myhudstart]; + } + +} + +#pragma mark -发送柜灯指令 +-(void)sendGuiDengCommend:(NSString *)lightSate +{ + + + RuSunGuiDeng*guidengModel=[[RuSunGuiDeng alloc]init]; + guidengModel.resavemacId = self.currentDevice.macAddress; + guidengModel.sendmacId = self.currentDevice.macAddress; + guidengModel.crc16Str=@"0000"; + guidengModel.onOff=lightSate; + + NSString* guidengOrder=[NSString stringWithFormat:@"%@%@%@",guidengModel.description,guidengModel.onOff,guidengModel.crc16Str]; + NSData*guidengData=[dataContorl stringToHexData:guidengOrder]; + [[Socketsingleton sharedInstance] soketWriteData:guidengData]; + + if ([Socketsingleton sharedInstance].clientSocket.isConnected) { + //soket 未断开时显示 + [self initHUD]; + [self.myhud myhudstart]; + } +} + +#pragma mark -加热制冷温度选择 + +-(void)sureBtnClick:(UIButton *)btn{ + + NSLog(@"%@******** _wenduPicview.picViewResultString",_wenduPicview.picViewResultString); + if (_wenduPicview.picViewResultString ==nil) { + + [_wenduPicview removeFromSuperview]; + + }else{ + + JiaReWenDuModel *model=[[JiaReWenDuModel alloc] init]; + model.resavemacId = self.currentDevice.macAddress; + model.sendmacId = self.currentDevice.macAddress; + int intlowString = [_wenduPicview.picViewResultString intValue]; + int newIntlowString=intlowString*10; + + NSLog(@"%d******** newIntlowString",newIntlowString); + // 转四位16进制 + model.JiaReWenDu=[dataContorl tpIntStringToFourHex:newIntlowString]; + model.crc16Code =@"0000"; + + NSString * hexstring=[NSString stringWithFormat:@"%@%@%@",model.description,model.JiaReWenDu,model.crc16Code]; + NSData*data=[dataContorl stringToHexData:hexstring]; + + [ [Socketsingleton sharedInstance] soketWriteData:data]; + } + + [_wenduPicview removeFromSuperview]; + +} + +-(void)ruSunJiaReMianQue +{ + RuiMeiProtocolModel*backmodel=[[DataCenter defaultDtacenter]valueForKey:DataCenterRuiMeiModelKey]; + UInt64 mac=[dataContorl hexToTen:backmodel.heatTemperature]; + NSLog(@"%llu",mac); + float TPlabel=mac/10; + int temp= (int)(TPlabel+0.5); + NSString *stringFloat = [NSString stringWithFormat:@"%d",temp]; + NSLog(@"%@",stringFloat); + NSArray*wenDuArr=[_wenduPicview.picArr objectAtIndex:0]; + + dispatch_async(_ruSunMainQueue, ^{ + for (NSInteger i=0; i { dispatch_queue_t _songNuoMainQueue; + CGFloat _tableviewSizeHeight; } @property(nonatomic,strong) SongNuoDBSetViewController *songNuoSetVC; @@ -58,8 +59,26 @@ [self.setbackBtn addTarget:self action:@selector(songNuoBDSetBtnAction) forControlEvents:UIControlEventTouchUpInside]; UITapGestureRecognizer*tapgestureRecognizer=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(songNuoBDSetBtnAction:)]; [self.setImag addGestureRecognizer:tapgestureRecognizer]; + + [self.tableView addObserver:self forKeyPath:@"contentSize" options:NSKeyValueObservingOptionNew context:nil]; } + +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { + if ([keyPath isEqualToString:@"contentSize"]) { + NSValue *new = [change valueForKey:NSKeyValueChangeNewKey]; + CGSize size = [new CGSizeValue]; + if (size.height == 0) { + self.tableView.contentSize = CGSizeMake(size.width, _tableviewSizeHeight); + } + } else { + [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; + } +} + +- (void)dealloc { + [self.tableView removeObserver:self forKeyPath:@"contentSize"]; +} #pragma mark- 设置 -(void)songNuoBDSetBtnAction{ @@ -125,87 +144,6 @@ -(void)initSongNuoBDUI { - NSArray *nameArr=@[@"PFLight1_off",@"PFLight1_off",@"ChongLang_off",@"O2_off",@"",@"PFkilLlight_off",@"JiaReBang_off"]; - - CGFloat btnControlWith = 70; - CGFloat btnControlPlace = (kScreenSize.width - 3*btnControlWith )/4; - - for (int i = 0; i < 3; i ++) { - - self.button = [[UIButton alloc] init] ; - self.button.frame = CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith),kScreenSize.height - 3*btnControlPlace - 2 *btnControlWith -10 , btnControlWith, btnControlWith +11); - - [self.button setImage:[UIImage imageNamed:nameArr[i]] forState:UIControlStateNormal]; - //self.button.backgroundColor = [UIColor redColor]; - self.button.tag=600000+i; - [self.button addTarget:self action:@selector(songNuoBDBtnClick:) forControlEvents:UIControlEventTouchUpInside]; - - - UILabel* textLbl = [[UILabel alloc] initWithFrame:CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith),kScreenSize.height - 3*btnControlPlace - 2 *btnControlWith -20 + btnControlWith , btnControlWith, btnControlPlace - 5)]; - //textLbl.backgroundColor = [UIColor blackColor]; - textLbl.textColor = [UIColor colorWithRed:250/255.0f green:255/255.0f blue:255/254.0f alpha:1]; - textLbl.textAlignment = NSTextAlignmentCenter; - NSArray *arr = @[@"灯1",@"灯2",@"水泵"]; - textLbl.text = arr[i]; - - textLbl.font = [UIFont boldSystemFontOfSize:14]; - - - [self.tableView addSubview:textLbl]; - [self.tableView addSubview:self.button]; - - if (i==0) { - - self.nuoLight1Btn = self.button; - self.light1Name = textLbl; - }else if (i==1){ - - self.nuoLight2Btn = self.button; - self.light2Name = textLbl; - }else if (i==2){ - self.nuoWaterPumpBtn = self.button; - self.waterPumpName = textLbl; - } - - } - - CGFloat btnControlPlace1 = (kScreenSize.width - 2*btnControlWith )/3; - - for (int i = 0; i < 3; i ++) { - self.button = [[UIButton alloc] init] ; - self.button.frame =CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith),kScreenSize.height - 2*btnControlPlace - btnControlWith -25, btnControlWith, btnControlWith +11); - - [self.button setImage:[UIImage imageNamed:nameArr[i+3]]forState:UIControlStateNormal]; - - self.button.tag= 600003+i; - [self.button addTarget:self action:@selector(songNuoBDBtnClick:) forControlEvents:UIControlEventTouchUpInside]; - - UILabel* textLbl = [[UILabel alloc] initWithFrame:CGRectMake(btnControlPlace1 +i*(btnControlPlace1 + btnControlWith), kScreenSize.height - 2*btnControlPlace - btnControlWith -35 + btnControlWith, btnControlWith, btnControlPlace - 5)]; - //textLbl.backgroundColor = [UIColor blackColor]; - textLbl.textAlignment = NSTextAlignmentCenter; - textLbl.textColor = [UIColor colorWithRed:250/255.0f green:255/255.0f blue:255/254.0f alpha:1]; - NSArray *arr = @[@"氧泵",@"柜灯",@"加热棒"]; - textLbl.font = [UIFont boldSystemFontOfSize:14]; - textLbl.text = arr[i]; - - [self.tableView addSubview:textLbl]; - [self.tableView addSubview:self.button]; - - if (i==0) { - - self.nuoAirPumpBtn = self.button; - self.airPumpName = textLbl; - }else if (i==1){ - - self.nuoGuiDengBtn = self.button; - self.guiDengName = textLbl; - }else if (i==1){ - - self.nuoJiaReBtn = self.button; - self.jiaReName = textLbl; - } - } - //重置 self.bubble 的 frame CGFloat animViewHeight= kScreenSize.width/4; if (kScreenSize.height==480) { @@ -247,8 +185,103 @@ } - [self initCHNames]; + NSArray *nameArr=@[@"PFLight1_off",@"PFLight1_off",@"ChongLang_off",@"O2_off",@"PFkilLlight_off",@"JiaReBang"]; + CGFloat btnControlWith = 70; + CGFloat btnControlPlace = (kScreenSize.width - 3*btnControlWith )/4; + + CGFloat currentY = CGRectGetMaxY(self.bubble.frame); + + for (int i = 0; i < 3; i ++) { + + self.button = [[UIButton alloc] init] ; + self.button.frame = CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith),currentY , btnControlWith, btnControlWith +11); + + [self.button setImage:[UIImage imageNamed:nameArr[i]] forState:UIControlStateNormal]; + //self.button.backgroundColor = [UIColor redColor]; + self.button.tag=600000+i; + [self.button addTarget:self action:@selector(songNuoBDBtnClick:) forControlEvents:UIControlEventTouchUpInside]; + + + UILabel* textLbl = [[UILabel alloc] initWithFrame:CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith),currentY + btnControlWith +11 - 6, btnControlWith, 14)]; + //textLbl.backgroundColor = [UIColor blackColor]; + textLbl.textColor = [UIColor colorWithRed:250/255.0f green:255/255.0f blue:255/254.0f alpha:1]; + textLbl.textAlignment = NSTextAlignmentCenter; + NSArray *arr = @[@"灯1",@"灯2",@"水泵"]; + textLbl.text = arr[i]; + + textLbl.font = [UIFont boldSystemFontOfSize:14]; + + + [self.tableView addSubview:textLbl]; + [self.tableView addSubview:self.button]; + + if (i==0) { + + self.nuoLight1Btn = self.button; + self.light1Name = textLbl; + }else if (i==1){ + + self.nuoLight2Btn = self.button; + self.light2Name = textLbl; + }else if (i==2){ + self.nuoWaterPumpBtn = self.button; + self.waterPumpName = textLbl; + } + + if (i == 2) { + currentY = CGRectGetMaxY(textLbl.frame); + } + } + + for (int i = 0; i < 3; i ++) { + self.button = [[UIButton alloc] init] ; + self.button.frame =CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith),currentY + 6, btnControlWith, btnControlWith +11); + + [self.button setImage:[UIImage imageNamed:nameArr[i+3]]forState:UIControlStateNormal]; + + self.button.tag= 600003+i; + [self.button addTarget:self action:@selector(songNuoBDBtnClick:) forControlEvents:UIControlEventTouchUpInside]; + if (i == 2) { + UILabel *tempLbl = [UILabel new]; + [self.button addSubview:tempLbl]; + tempLbl.tag = 1; + tempLbl.font = [UIFont boldSystemFontOfSize:16]; + tempLbl.textColor = [UIColor lightGrayColor]; + tempLbl.textAlignment = NSTextAlignmentCenter; + tempLbl.translatesAutoresizingMaskIntoConstraints = NO; + [NSLayoutConstraint constraintWithItem:tempLbl attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.button attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:0.0].active = YES; + [NSLayoutConstraint constraintWithItem:tempLbl attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self.button attribute:NSLayoutAttributeCenterY multiplier:1.0 constant:-4.0].active = YES; + } + UILabel* textLbl = [[UILabel alloc] initWithFrame:CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith),currentY + btnControlWith +11, btnControlWith, 14)]; + //textLbl.backgroundColor = [UIColor blackColor]; + textLbl.textAlignment = NSTextAlignmentCenter; + textLbl.textColor = [UIColor colorWithRed:250/255.0f green:255/255.0f blue:255/254.0f alpha:1]; + NSArray *arr = @[@"氧泵",@"柜灯",@"加热棒"]; + textLbl.font = [UIFont boldSystemFontOfSize:14]; + textLbl.text = arr[i]; + + [self.tableView addSubview:textLbl]; + [self.tableView addSubview:self.button]; + + if (i==0) { + + self.nuoAirPumpBtn = self.button; + self.airPumpName = textLbl; + }else if (i==1){ + + self.nuoGuiDengBtn = self.button; + self.guiDengName = textLbl; + }else if (i==2){ + + self.nuoJiaReBtn = self.button; + self.jiaReName = textLbl; + } + + _tableviewSizeHeight = 64 + CGRectGetMaxY(textLbl.frame); + + } + [self initCHNames]; } -(void)songNuoBDBtnClick:(UIButton*)btn{ @@ -390,7 +423,7 @@ { btn.userInteractionEnabled=YES; - [btn setImage:[UIImage imageNamed:@"PFkilLlight_on.png"] forState:UIControlStateSelected]; + [btn setImage:[UIImage imageNamed:@"PFkilLlight_on.png"] forState:UIControlStateNormal]; lightModel.lightNumber=@"05";// NSString*switchString2=[NSString stringWithFormat:@"%@%@%@%@",switchString1,lightModel.lightNumber,lightModel.switchBtn,lightModel.crc16Str]; diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/SongNuo/SongNuo86Byte/SongNuoDBSetViewController.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/SongNuo/SongNuo86Byte/SongNuoDBSetViewController.m index 76dc1d2..25bd2a9 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/SongNuo/SongNuo86Byte/SongNuoDBSetViewController.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/SongNuo/SongNuo86Byte/SongNuoDBSetViewController.m @@ -825,8 +825,8 @@ -(void)songNuoremindCyclePicDone{ - if (_indexpath.section==0&&_indexpath.row==3) { - +// if (_indexpath.section==0&&_indexpath.row==3) { + ChangeWaterCell*cell=[self.tableView cellForRowAtIndexPath:_indexpath]; NSString *str=_remindPic.picViewResultString; @@ -867,7 +867,7 @@ [_remindPic removeFromSuperview]; - } +// } } #pragma mark 默认换水时间 diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/SongNuo/SongNuoBackMsgDataUnity.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/SongNuo/SongNuoBackMsgDataUnity.m index 02976c9..1387fb1 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/SongNuo/SongNuoBackMsgDataUnity.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/SongNuo/SongNuoBackMsgDataUnity.m @@ -471,15 +471,18 @@ //加热 注意只有一个字节 加热棒只控制温度不设置开关 开关状态服务器返回 NSString*stateString6=[backModel.heatStickState substringWithRange:NSMakeRange(0, 2)]; - - if ([stateString6 isEqualToString:@"01"]) { - [JiaReBtn setImage:[UIImage imageNamed:@"JiaReBang_on.png"] forState:UIControlStateNormal]; - JiaReBtn.selected=YES; + UInt64 mac=[dataContorl hexToTen:backModel.heatTemperature]; + float TPlabel=mac/10; + int temp= (int)(TPlabel+0.5); + NSString *stringFloat = [NSString stringWithFormat:@"%d",temp]; + UILabel *lbl = [JiaReBtn viewWithTag:1]; + if ([stateString6 isEqualToString:@"01"]){ + //加热 + lbl.textColor = JWUIColorFromRGB(0x38b9fc); }else{ - JiaReBtn.selected=NO; - [JiaReBtn setImage:[UIImage imageNamed:@"JiaReBang_off.png"] forState:UIControlStateNormal]; + lbl.textColor = [UIColor lightGrayColor]; } - + lbl.text = [NSString stringWithFormat:@"%@°C", stringFloat]; } +(NSArray*)refreshSongNuoBD86TimerAddTempWithBackMassageModel:(SongNuoBDProtocol*)backModel diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/ThreeControl/ThreeControlCenterViewController.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/ThreeControl/ThreeControlCenterViewController.m index 1d312f7..ff78375 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/ThreeControl/ThreeControlCenterViewController.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/ThreeControl/ThreeControlCenterViewController.m @@ -94,9 +94,14 @@ typedef NS_ENUM(NSInteger,ThreeControBackMsgTape){ self.button.tag=201+i; - + CGFloat y = 0; + if (is_iPhone_X) { + y = kScreenSize.height - (btnControlPlace - 10) - btnControlWith -10 -64 - 34; + } else { + y = kScreenSize.height - (btnControlPlace - 10) - btnControlWith -10 -64; + } - self.button.frame=CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith * 105 / 122), kScreenSize.height - (btnControlPlace - 10) - btnControlWith -10 -64 , btnControlWith * 105 / 122, btnControlWith ); + self.button.frame=CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith * 105 / 122), y, btnControlWith * 105 / 122, btnControlWith ); //self.button.frame=CGRectMake1(wSpace1+(i%3)*(60+wSpace1), kScreenSize.height-80-64,60, 60); @@ -121,8 +126,13 @@ typedef NS_ENUM(NSInteger,ThreeControBackMsgTape){ NSArray*arry=@[@"灯1",@"灯2",@"UV/冲浪"]; for (int j=0; j @property(nonatomic,strong)UITableView *tableView; @@ -32,8 +34,8 @@ extern BOOL firstLogIn; } -(void)loadData{ - self.titles=@[@[@"更换手机",@"修改密码"],@[@"切换账号"]]; - self.imgs = @[@[@"personal_iocn_replace",@"replace_iocn_code"],@[@"personal_iocn_switch"]]; + self.titles=@[@[@"更换手机",@"修改密码",@"恢复出厂模式"],@[@"切换账号"]]; + self.imgs = @[@[@"personal_iocn_replace",@"replace_iocn_code",@"setting-reset"],@[@"personal_iocn_switch"]]; } -(void)creatTab{ @@ -61,16 +63,12 @@ extern BOOL firstLogIn; } -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ - if (section==1) { - - return 1; - } - return 2; + return [self.titles[section] count]; } -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ - return 2; + return self.titles.count; } @@ -120,7 +118,12 @@ extern BOOL firstLogIn; ChangeSecretCodeController *secretVC=[[ChangeSecretCodeController alloc]init]; [self.navigationController pushViewController:secretVC animated:YES]; - }else if (indexPath.section==1&&indexPath.row==0){ + } else if (indexPath.section == 0 && indexPath.row == 2) { + self.hidesBottomBarWhenPushed = YES; + SettingResetViewController *vc = [[SettingResetViewController alloc] initWithNibName:@"SettingResetViewController" bundle:nil]; + vc.hidesBottomBarWhenPushed = YES; + [self.navigationController pushViewController:vc animated:YES]; + } else if (indexPath.section==1&&indexPath.row==0){ UIAlertView*alert=[[UIAlertView alloc]initWithTitle:@"提醒" message:@"确认切换账号并重新登录?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil]; alert.tag=TUICHUAlertTAg; diff --git a/Ifish/controllers/IfishTabControllers/我的/mineControllers/SettingResetViewController.h b/Ifish/controllers/IfishTabControllers/我的/mineControllers/SettingResetViewController.h new file mode 100644 index 0000000..6975757 --- /dev/null +++ b/Ifish/controllers/IfishTabControllers/我的/mineControllers/SettingResetViewController.h @@ -0,0 +1,13 @@ +// +// SettingResetViewController.h +// Ifish +// +// Created by Minghao Xue on 2018/7/24. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import "BaseVIewContorller.h" + +@interface SettingResetViewController : BaseVIewContorller + +@end diff --git a/Ifish/controllers/IfishTabControllers/我的/mineControllers/SettingResetViewController.m b/Ifish/controllers/IfishTabControllers/我的/mineControllers/SettingResetViewController.m new file mode 100644 index 0000000..b6ca77d --- /dev/null +++ b/Ifish/controllers/IfishTabControllers/我的/mineControllers/SettingResetViewController.m @@ -0,0 +1,78 @@ +// +// SettingResetViewController.m +// Ifish +// +// Created by Minghao Xue on 2018/7/24. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import "SettingResetViewController.h" +#import "IFishHotpotUDPHelper.h" +#import "ConnectHotspotTipViewController.h" +#import "DeviceCameraModel.h" +#import "DeviceModel.h" +#import "MBProgressHUD.h" +#import + +@interface SettingResetViewController () + +@property (nonatomic, strong) DeviceModel *currentDevice; +@property (nonatomic, strong) MBProgressHUD *HUD; + +@end + +@implementation SettingResetViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + self.title = @"恢复出厂设置"; + +} + +- (IBAction)reset:(id)sender { + if (![[self currentWifiSSID].lowercaseString hasPrefix:@"ifish"]) { + [self.view makeToast:@"请先将手机连接到wifi:ifish-xxxx"]; + return; + } + self.HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES]; + self.HUD.mode = MBProgressHUDModeIndeterminate; + self.HUD.labelText = @"重置指令已发出"; + [IFishHotpotUDPHelper sharedInstance].delegate = self; + [[IFishHotpotUDPHelper sharedInstance] broadCastRestCommand]; +} + +- (IBAction)tipBtnClicked:(id)sender { + ConnectHotspotTipViewController *vc = [[ConnectHotspotTipViewController alloc] initWithNibName:nil bundle:nil]; + [self.navigationController pushViewController:vc animated:YES]; +} + +#pragma mark - IFishHotpotUDPHelperDelegate + +- (void)udpHelperCommandExecutedSuccess:(IFishUDPHelperBackMsgModel *)backModel { + self.HUD.mode = MBProgressHUDModeText; + self.HUD.labelText = @"设备已重置"; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [MBProgressHUD hideHUDForView:self.view animated:YES]; + }); +} + +- (void)udpHelperMessage:(NSString *)msg { +// [self.view makeToast:msg]; +} + +#pragma mark - 删除设备 + +- (NSString *)currentWifiSSID { + NSString *ssid = @"Not Found"; + CFArrayRef myArray = CNCopySupportedInterfaces(); + if (myArray != nil) { + CFDictionaryRef myDict = CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray, 0)); + if (myDict != nil) { + NSDictionary *dict = (NSDictionary *)CFBridgingRelease(myDict); + ssid = [dict valueForKey:@"SSID"]; + } + } + return ssid; +} + +@end diff --git a/Ifish/controllers/IfishTabControllers/我的/mineControllers/SettingResetViewController.xib b/Ifish/controllers/IfishTabControllers/我的/mineControllers/SettingResetViewController.xib new file mode 100644 index 0000000..4b46bad --- /dev/null +++ b/Ifish/controllers/IfishTabControllers/我的/mineControllers/SettingResetViewController.xib @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ifish/controllers/IfishTabControllers/我的/mineControllers/pushSetControllrs/AboutUsViewController.m b/Ifish/controllers/IfishTabControllers/我的/mineControllers/pushSetControllrs/AboutUsViewController.m index a62a6b4..136f471 100644 --- a/Ifish/controllers/IfishTabControllers/我的/mineControllers/pushSetControllrs/AboutUsViewController.m +++ b/Ifish/controllers/IfishTabControllers/我的/mineControllers/pushSetControllrs/AboutUsViewController.m @@ -25,7 +25,12 @@ // CFShow((__bridge CFTypeRef)(infoDic)); NSString *app_Version=[infoDic objectForKey:@"CFBundleShortVersionString"]; NSLog(@"app_Version%@",app_Version); - self.versionLabel.text=[NSString stringWithFormat:@"v%@",app_Version]; + NSString *versionStr = [NSString stringWithFormat:@"v%@",app_Version]; + NSString *buildVersion = [infoDic objectForKey:@"CFBundleVersion"]; + if (buildVersion.length > 0) { + versionStr = [versionStr stringByAppendingString:[NSString stringWithFormat:@"(%@)", buildVersion]]; + } + self.versionLabel.text=versionStr; //build 版本 // NSString *app_build=[infoDic objectForKey:@"CFBundleVersion"]; diff --git a/Ifish/controllers/IfishTabControllers/我的/mineControllers/pushSetControllrs/IfishUDPBroadCastHelper.m b/Ifish/controllers/IfishTabControllers/我的/mineControllers/pushSetControllrs/IfishUDPBroadCastHelper.m index 4b38575..594f140 100644 --- a/Ifish/controllers/IfishTabControllers/我的/mineControllers/pushSetControllrs/IfishUDPBroadCastHelper.m +++ b/Ifish/controllers/IfishTabControllers/我的/mineControllers/pushSetControllrs/IfishUDPBroadCastHelper.m @@ -28,7 +28,7 @@ -(void)broadCaseUDP{ - self.loopTimer = [NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(sendLoopSoketdata) userInfo:nil repeats:YES]; + self.loopTimer = [NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(sendConnectHotspotSoketdata) userInfo:nil repeats:YES]; } diff --git a/Ifish/controllers/IfishTabControllers/探索/IfishLive/IfishNewLiveList/LoveFishLiveListBaseViewController.m b/Ifish/controllers/IfishTabControllers/探索/IfishLive/IfishNewLiveList/LoveFishLiveListBaseViewController.m index 8d62e26..aa64458 100644 --- a/Ifish/controllers/IfishTabControllers/探索/IfishLive/IfishNewLiveList/LoveFishLiveListBaseViewController.m +++ b/Ifish/controllers/IfishTabControllers/探索/IfishLive/IfishNewLiveList/LoveFishLiveListBaseViewController.m @@ -80,8 +80,9 @@ pageController.selectIndex = 0; //pageController.menuViewBottomSpace = 10; [self addChildViewController: pageController]; + CGFloat height = [UIApplication sharedApplication].statusBarFrame.size.height + 44; //看看在tab中时 - pageController.viewFrame = CGRectMake(0,64,self.view.frame.size.width, self.view.frame.size.height - 64) ; + pageController.viewFrame = CGRectMake(0,height,self.view.frame.size.width, self.view.frame.size.height - height) ; self.pageController = pageController; [self.view addSubview: pageController.view]; diff --git a/Ifish/controllers/IfishTabControllers/消息/IfishIMFiles/IfishChatVC/IfishSessionViewController.m b/Ifish/controllers/IfishTabControllers/消息/IfishIMFiles/IfishChatVC/IfishSessionViewController.m index 64387e2..4a646f9 100644 --- a/Ifish/controllers/IfishTabControllers/消息/IfishIMFiles/IfishChatVC/IfishSessionViewController.m +++ b/Ifish/controllers/IfishTabControllers/消息/IfishIMFiles/IfishChatVC/IfishSessionViewController.m @@ -143,7 +143,7 @@ NIMContactSelectDelegate //黑色 UIButton *bakbutton = [UIButton buttonWithType:UIButtonTypeCustom]; bakbutton.frame = CGRectMake(0,0,48,44); - [bakbutton setImage:[UIImage imageNamed:@"arrow_l"] forState:UIControlStateNormal]; + [bakbutton setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal]; [bakbutton addTarget: self action: @selector(goBackAction) forControlEvents: UIControlEventTouchUpInside]; diff --git a/Ifish/controllers/IfishTabControllers/消息/IfishIMFiles/Sessions/SessionList/ViewController/NTESSessionListViewController.m b/Ifish/controllers/IfishTabControllers/消息/IfishIMFiles/Sessions/SessionList/ViewController/NTESSessionListViewController.m index e7a6fc3..11fbff7 100644 --- a/Ifish/controllers/IfishTabControllers/消息/IfishIMFiles/Sessions/SessionList/ViewController/NTESSessionListViewController.m +++ b/Ifish/controllers/IfishTabControllers/消息/IfishIMFiles/Sessions/SessionList/ViewController/NTESSessionListViewController.m @@ -91,7 +91,7 @@ //消息列表不在tab栏中时设置返回按钮 UIButton *bakbutton = [UIButton buttonWithType:UIButtonTypeCustom]; bakbutton.frame = CGRectMake(0,0,48,44); - [bakbutton setImage:[UIImage imageNamed:@"arrow_l"] forState:UIControlStateNormal]; + [bakbutton setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal]; [bakbutton addTarget: self action: @selector(backAction) forControlEvents: UIControlEventTouchUpInside]; diff --git a/Ifish/controllers/IfishTabControllers/设备/IfishDeviceViewController.m b/Ifish/controllers/IfishTabControllers/设备/IfishDeviceViewController.m index 41d2eae..cd0e61e 100644 --- a/Ifish/controllers/IfishTabControllers/设备/IfishDeviceViewController.m +++ b/Ifish/controllers/IfishTabControllers/设备/IfishDeviceViewController.m @@ -688,6 +688,9 @@ [self.tableView addGestureRecognizer:longpress]; _scrollHeight = 64; + if (@available(iOS 11.0, *)) { + self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; + } } -(void)addLongPressGesture:(UILongPressGestureRecognizer *)guesture diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m index f130df4..9241b79 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m @@ -66,6 +66,8 @@ #import "RunSun84CHSetViewController.h" #import "HaveHotCoolWenDuPicview.h" #import "RuSunLightOrder.h" +#import "RuiMeiSetViewController.h" + //上部分视频封装 下部分分段控制器 封装 (下一步代码优化) @interface IfishP2PMonitorController () { @@ -103,6 +105,7 @@ @property(nonatomic,strong) KeLiAiSetViewController *keLiAiSetVc; @property(nonatomic,strong) RusunHaveHeateSetViewController *rusunSet; @property(nonatomic,strong) RunSun84CHSetViewController *rusun84Set; +@property (nonatomic, strong) RuiMeiSetViewController *ruimeiSet; @property(nonatomic,strong) DXPopover *popover; @property(nonatomic,strong) UIButton *rightPopButton; @property (nonatomic,strong) SetNameTextViewController *setNameVC; @@ -468,7 +471,7 @@ [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"blackbar.png"] forBarMetrics:UIBarMetricsDefault]; UIButton*leftBtn = [UIButton buttonWithType:UIButtonTypeCustom]; leftBtn.frame = CGRectMake(0, 0, 47,44); - [leftBtn setBackgroundImage:[UIImage imageNamed:@"arrow_l"] forState:UIControlStateNormal]; + [leftBtn setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal]; [leftBtn addTarget: self action: @selector(btnClickToBack:) forControlEvents: UIControlEventTouchUpInside]; UIBarButtonItem * lbbItem=[[UIBarButtonItem alloc]initWithCustomView:leftBtn]; self.navigationItem.leftBarButtonItem=lbbItem; @@ -4002,6 +4005,19 @@ [self.navigationController pushViewController:_rusun84Set animated:YES]; + }else if ([dmodel.type isEqualToString:DECICE_TYPE_RUIMEI]){ + _ruimeiSet = [[RuiMeiSetViewController alloc] init]; + _ruimeiSet.currentdevice = dmodel; + NSString*stateString=[self.fishControlView.ruiMeiBack.customModel substringWithRange:NSMakeRange(2, 2)]; + if ([stateString isEqualToString:@"01"]) { + _ruimeiSet.customModeOn=YES; + }else{ + _ruimeiSet.customModeOn=NO; + } + usleep(50*1000); + [self.navigationController pushViewController:_ruimeiSet animated:YES]; + + }else if ([dmodel.type isEqualToString:DECICE_TYPE_JUNENGCC]){ @@ -4149,6 +4165,19 @@ [_rusun84Set.tableView reloadData]; + }else if ([dmodel.type isEqualToString:DECICE_TYPE_RUIMEI]){ + _ruimeiSet.timeArr = timerArr; + [_ruimeiSet.indicatorView stopAnimating]; + + NSString*stateString=[self.fishControlView.ruiMeiBack.customModel substringWithRange:NSMakeRange(2, 2)]; + if ([stateString isEqualToString:@"01"]) { + _ruimeiSet.customModeOn=YES; + }else{ + _ruimeiSet.customModeOn=NO; + } + [_ruimeiSet.tableView reloadData]; + + }else if ([dmodel.type isEqualToString:DECICE_TYPE_JUNENGCC]){ @@ -4571,7 +4600,19 @@ [self setHotCoolMianQueueWithUint64:mac]; } +#pragma mark - 瑞美 +-(void)selectRuiMeiIndex:(NSIndexPath *)index withbackModle:(RuiMeiProtocolModel *)backModel { + [self showWenDuPic]; + [self setMeiMianQueue]; +} + +-(void)setMeiMianQueue +{ + RuiMeiProtocolModel*backmodel=[[DataCenter defaultDtacenter]valueForKey:DataCenterRuiMeiModelKey]; + UInt64 mac=[dataContorl hexToTen:backmodel.heatTemperature]; + [self setMianQueueWithUint64:mac]; +} #pragma mark - 松诺BD 加热棒 -(void)selectSongNuoBDIndex:(NSIndexPath *)index withBackModel:(SongNuoBDProtocol *)backModel{ diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/ScreenShotView/ShotScreenImgViewController.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/ScreenShotView/ShotScreenImgViewController.m index 3906142..3589e46 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/ScreenShotView/ShotScreenImgViewController.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/ScreenShotView/ShotScreenImgViewController.m @@ -38,8 +38,8 @@ UIButton *back = [UIButton buttonWithType:UIButtonTypeCustom]; back.frame = CGRectMake(0,0,48,44); - [back setImage:[UIImage imageNamed:@"arrow_l"] forState:UIControlStateNormal]; - // [_bakbutton setBackgroundImage:[UIImage imageNamed:@"arrow_l"] forState:UIControlStateNormal]; + [back setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal]; + // [_bakbutton setBackgroundImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal]; [back addTarget: self action: @selector(goBackAction) forControlEvents: UIControlEventTouchUpInside]; diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/YooseeNextConnectViewController.mm b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/YooseeNextConnectViewController.mm index e448b91..e7dd717 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/YooseeNextConnectViewController.mm +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/YooseeNextConnectViewController.mm @@ -562,8 +562,13 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) { //967/1018/ 0.95 CGFloat percentHbiW = 0.117 ;//5s 35/300 - - self.nodImg= [[UIImageView alloc] initWithFrame:CGRectMake(5, 20 + 64,12, 12)]; + CGFloat y; + if (is_iPhone_X) { + y = 20 + 88; + } else { + y = 20 + 64; + } + self.nodImg= [[UIImageView alloc] initWithFrame:CGRectMake(5, y,12, 12)]; self.nodImg.image = [UIImage imageNamed:@"linkingdevice_point"]; [self.view addSubview:self.nodImg]; @@ -587,7 +592,7 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) { CGFloat labelSizeW = [self widthForString:self.wifilabel.text fontSize:18 andHeight:10]; CGFloat labelH= [self heightForString:self.wifilabel.text fontSize:18 andWidth:labelSizeW]; - self.wifilabel.frame = CGRectMake(CGRectGetMaxX(self.nodImg.frame), 20 + 64, labelSizeW, labelH); + self.wifilabel.frame = CGRectMake(CGRectGetMaxX(self.nodImg.frame), y, labelSizeW, labelH); [self.view addSubview:self.wifilabel]; //wifi 输入框 @@ -973,8 +978,14 @@ withFilterContext:(id)filterContext { if (!self.connectingView) { + CGFloat yOffset = 0; + if (is_iPhone_X) { + yOffset = 88; + } else { + yOffset = 64; + } - IfishConnectingView *connectingView=[[IfishConnectingView alloc] initWithFrame:CGRectMake(0,64, kScreenSize.width, CGRectGetMaxY(self.wifiSecFiled.frame))]; + IfishConnectingView *connectingView=[[IfishConnectingView alloc] initWithFrame:CGRectMake(0,yOffset, kScreenSize.width, CGRectGetMaxY(self.wifiSecFiled.frame))]; self.connectingView =connectingView; [self.connectingView.textChangeView animationWithTexts:[NSArray arrayWithObjects:@"正在拼命连接中...",@"请将摄像头放在wifi信号良好的位置",@"连接时,请开大手机音量",@"连接过程会持续40s左右,请耐心等待",@"连接不上,请点击下方说明书",nil]]; diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/BootomViewSoketBackMasgConreol.h b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/BootomViewSoketBackMasgConreol.h index ab33fe8..9c83df0 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/BootomViewSoketBackMasgConreol.h +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/BootomViewSoketBackMasgConreol.h @@ -18,6 +18,8 @@ #import "RuSunProtocol.h" #import "SongNuoBDProtocol.h" #import "RunSun84Protocol.h" +#import "RuiMeiProtocolModel.h" + @interface BootomViewSoketBackMasgConreol : NSObject //获取温度 +(NSString*)getTempWithSoketData:(NSData *)data; @@ -59,5 +61,7 @@ indexPath; +(void)SongnuoBDCommandSelectorWithBackMode86:(SongNuoBDProtocol *)model atindexPath:(NSIndexPath *)indexPath; +//瑞美 ++(void)RuiMeiCommandSelectorWithBackMode168:(RuiMeiProtocolModel *)model atindexPath:(NSIndexPath *)indexPath; @end diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/BootomViewSoketBackMasgConreol.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/BootomViewSoketBackMasgConreol.m index 1a6cd80..b6f6eb2 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/BootomViewSoketBackMasgConreol.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/BootomViewSoketBackMasgConreol.m @@ -84,6 +84,10 @@ //睿芯 86 字节 str=[str substringWithRange:NSMakeRange(148,IFISH_TEMPERATURE_BYTE2)]; + }else if ([type isEqualToString:DECICE_TYPE_RUIMEI]){ + //瑞美 + str=[str substringWithRange:NSMakeRange(148,IFISH_TEMPERATURE_BYTE2)]; + } UInt64 mac=[dataContorl hexToTen:str]; @@ -762,6 +766,81 @@ indexPath{ } ++(void)RuiMeiCommandSelectorWithBackMode168:(RuiMeiProtocolModel *)model atindexPath:(NSIndexPath *)indexPath +{ + + NSInteger index= indexPath.row - 3; + manulswitchMSModel*manulModel=[[manulswitchMSModel alloc]init]; + [[Socketsingleton sharedInstance] setSoketLightDataWith:manulModel]; + NSString*switchString=manulModel.description; + + if (index == 0) { + + manulModel.lightNumber = @"01"; + if([[model.ch1 substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"]) + { + manulModel.switchBtn = @"01"; + + }else{ + + manulModel.switchBtn = @"00"; + } + + }else if (index == 1){ + + manulModel.lightNumber = @"02"; + if([[model.ch2 substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"]) + { + manulModel.switchBtn = @"01"; + + }else{ + + manulModel.switchBtn = @"00"; + } + + + }else if (index == 2){ + + + manulModel.lightNumber = @"03"; + if([[model.ch3 substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"]) + { + manulModel.switchBtn = @"01"; + + }else{ + + manulModel.switchBtn = @"00"; + } + + + }else if (index == 3){ + + + manulModel.lightNumber = @"04"; + if([[model.ch4 substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"]) + { + manulModel.switchBtn = @"01"; + + }else{ + + manulModel.switchBtn = @"00"; + } + + + }else if (index == 4){ + //加热棒 + return; + + } + + manulModel.crc16Str = @"0000"; + NSString*switchString2=[NSString stringWithFormat:@"%@%@%@%@",switchString,manulModel.lightNumber,manulModel.switchBtn,manulModel.crc16Str]; + NSData*manulData=[dataContorl stringToHexData:switchString2]; + + [[Socketsingleton sharedInstance] soketWriteData:manulData]; + +} + +(void)SongnuoBDCommandSelectorWithBackMode86:(SongNuoBDProtocol *)model atindexPath:(NSIndexPath *)indexPath { NSInteger index= indexPath.row - 3; diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/MonitorBootmView.h b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/MonitorBootmView.h index b1a7efe..aff274a 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/MonitorBootmView.h +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/MonitorBootmView.h @@ -30,6 +30,9 @@ #import "SongNuoBDProtocol.h" #import "RunSun84Protocol.h" #import "RuSun84BackMsgUtils.h" +#import "RuiMeiProtocolModel.h" +#import "RuiMeiBackMsgUtils.h" + @protocol MonitorBottomCollcetionSelectDelegate @optional @@ -67,6 +70,8 @@ -(void)selectRuSunIndex:(NSIndexPath*)index withbackModle:(RuSunProtocol *)backModel; -(void)selectRuSun84Index:(NSIndexPath*)index withbackModle:(RunSun84Protocol *)backModel; +//瑞美 +-(void)selectRuiMeiIndex:(NSIndexPath*)index withbackModle:(RunSun84Protocol *)backModel; //松诺 BD @@ -141,6 +146,7 @@ @property(nonatomic,strong) RuSunProtocol *ruSunBack; @property(nonatomic,strong) RunSun84Protocol *ruSun84Back; +@property (nonatomic, strong) RuiMeiProtocolModel *ruiMeiBack; @property(nonatomic,strong) SongNuoBDProtocol *songNuoBDBack; -(void)setTabViewWithFrame:(CGRect)frame; diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/MonitorBootmView.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/MonitorBootmView.m index 7f3d80c..082494b 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/MonitorBootmView.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/MonitorBootmView.m @@ -27,6 +27,9 @@ #import "ThreeControlName.h" #import "FourControlName.h" #import "XuToControlName.h" +#import "RuiMeiCHNameCustom.h" +#import "RuiMeiCHControl.h" + @implementation MonitorBootmView -(id)initWithFrame:(CGRect)frame @@ -605,7 +608,9 @@ return 3 + self.device.controlAmount.integerValue +1; - }else{ + } else if ([self.device.type isEqualToString:DECICE_TYPE_RUIMEI]) { + return 3 + 5; + } else { if (self.device.controlAmount.integerValue ==5) { @@ -659,6 +664,17 @@ withData:self.device addMassglength:self.dataLength]; + }else if ([self.device.type isEqualToString:DECICE_TYPE_RUIMEI]){ + + if (!_ruiMeiBack) { + [self makeToast:@"暂未连接"]; + return; + } + + [self.MonitorBottomDelegate didselectCollectionIex:indexPath + withData:self.device + addMassglength:self.dataLength]; + }else if ([self.device.type isEqualToString:DECICE_TYPE_JUNENGCC]){ @@ -843,6 +859,23 @@ } + }else if ([self.device.type isEqualToString:DECICE_TYPE_RUIMEI]){ + if (!_ruiMeiBack) { + [self makeToast:@"暂未连接"]; + return; + } + if (indexPath.row == 7) { + + //点击加热棒 + [self.MonitorBottomDelegate selectRuiMeiIndex:indexPath withbackModle:_ruiMeiBack]; + + }else{ + + [BootomViewSoketBackMasgConreol RuiMeiCommandSelectorWithBackMode168:_ruiMeiBack atindexPath:indexPath]; + [self makeToastActivity]; + } + + }else if ([self.device.type isEqualToString:DECICE_TYPE_JUNENGCC]){ @@ -1124,6 +1157,14 @@ [cell setRusuan84ControlBtnImg:self.btnImgArr addArr:self.btnOnImgArr atIndex:indexPath addBackModel:_ruSun84Back]; + }else if ([self.device.type isEqualToString:DECICE_TYPE_RUIMEI]){ + + if (!_ruiMeiBack) { + cell.controBtnImg.image = self.btnImgArr[indexPath.row - 3]; + [self makeToast:@"连接设备中..."]; + } + + [cell setRuiMeiControlBtnImg:self.btnImgArr addArr:self.btnOnImgArr atIndex:indexPath addBackModel:_ruiMeiBack]; }else if ([self.device.type isEqualToString:DECICE_TYPE_JUNENGCC]){ @@ -1337,7 +1378,24 @@ LXImageWithImageName(@"bootview_022_on"), LXImageWithImageName(@"bootview_heat_on")]; - }else{ + } else if ([self.device.type isEqualToString:DECICE_TYPE_RUIMEI]){ + //self.btnNameArr = @[@"灯1",@"灯2",@"水泵",@"氧泵",@"加热棒"]; + RuiMeiCHControl* ruimei = [RuiMeiCHNameCustom currentdevice:self.device.macAddress]; + self.btnNameArr = @[ruimei.ch1name,ruimei.ch2name,ruimei.ch3name,ruimei.ch4name,ruimei.jiaRe]; + + self.btnImgArr = @[LXImageWithImageName(@"bootview_light_off"), + LXImageWithImageName(@"bootview_light_off"), + LXImageWithImageName(@"bootview_shajun_off"), + LXImageWithImageName(@"bootview_co2_off"), + LXImageWithImageName(@"bootview_heat_off")]; + + self.btnOnImgArr = @[LXImageWithImageName(@"bootview_light_on"), + LXImageWithImageName(@"bootview_light_on"), + LXImageWithImageName(@"bootview_shajun_on"), + LXImageWithImageName(@"bootview_co2_on"), + LXImageWithImageName(@"bootview_heat_on")]; + + } else{ int controlAmount=[self.device.controlAmount intValue]; @@ -1608,6 +1666,26 @@ addMassglength:string1.length]; + }else if ([self.device.type isEqualToString:DECICE_TYPE_RUIMEI]){ + //瑞美 + if (!_ruiMeiBack) { + _ruiMeiBack = [[RuiMeiProtocolModel alloc] init]; + + } + + [RuiMeiBackMsgUtils readSoketDataWithBaackMassgModel:_ruiMeiBack addWithBackData:data]; + + self.temperature = [BootomViewSoketBackMasgConreol getTempNewWayWithSoketData:data adddeviceType:DECICE_TYPE_RUIMEI]; + + [self.collectionView reloadData]; + + NSArray *timerArr=[RuiMeiBackMsgUtils refreshRuSunTimerAddTemperatureWithBackMassageModel:_ruiMeiBack]; + + [self.MonitorBottomDelegate setTimeVCReloadDatawithTimerArr:timerArr + withData:self.device + addMassglength:string1.length]; + + }else if ([self.device.type isEqualToString:DECICE_TYPE_JUNENGCC]){ //巨能 diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/YseeCollectionCell/FishControlFourthCell.h b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/YseeCollectionCell/FishControlFourthCell.h index a1e105d..d09e213 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/YseeCollectionCell/FishControlFourthCell.h +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/YseeCollectionCell/FishControlFourthCell.h @@ -16,6 +16,8 @@ #import "RuSunProtocol.h" #import "SongNuoBDProtocol.h" #import "RunSun84Protocol.h" +#import "RuiMeiProtocolModel.h" + @interface FishControlFourthCell : UICollectionViewCell @property(nonatomic,strong) UIImageView *controBtnImg; @@ -80,4 +82,10 @@ atIndex:(NSIndexPath *)indexPath addBackModel:(SongNuoBDProtocol*)model; +// 瑞美 +-(void)setRuiMeiControlBtnImg:(NSArray *)imgOffArr + addArr:(NSArray *)imgOnArr + atIndex:(NSIndexPath *)indexPath + addBackModel:(RuiMeiProtocolModel*)model; + @end diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/YseeCollectionCell/FishControlFourthCell.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/YseeCollectionCell/FishControlFourthCell.m index d3ec595..b3a54b4 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/YseeCollectionCell/FishControlFourthCell.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/YseeCollectionCell/FishControlFourthCell.m @@ -397,6 +397,50 @@ } +} + +-(void)setRuiMeiControlBtnImg:(NSArray *)imgOffArr + addArr:(NSArray *)imgOnArr + atIndex:(NSIndexPath *)indexPath + addBackModel:(RuiMeiProtocolModel*)model +{ + NSInteger index = indexPath.row - 3; + if (index == 0) { + + NSString*stateString=[model.ch1 substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)]; + [self btnImgAtIndex:indexPath withStr:stateString addWithOnImg:imgOnArr + addOffArr:imgOffArr]; + }else if (index == 1){ + + NSString*stateString=[model.ch2 substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)]; + [self btnImgAtIndex:indexPath withStr:stateString addWithOnImg:imgOnArr + addOffArr:imgOffArr]; + + }else if (index == 2){ + + NSString*stateString=[model.ch3 substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)]; + [self btnImgAtIndex:indexPath withStr:stateString addWithOnImg:imgOnArr + addOffArr:imgOffArr]; + + }else if (index == 3){ + + NSString*stateString=[model.ch4 substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)]; + [self btnImgAtIndex:indexPath withStr:stateString addWithOnImg:imgOnArr + addOffArr:imgOffArr]; + + }else if (index == 4){ + //加热棒状态 + //加热棒状态 加热还是制冷 + //00 加热 01 制冷 + //model.heatStickState 加热棒开关状态 + NSString*stateString=[model.heatStickState substringWithRange:NSMakeRange(0, IFISH_LIGHTBTN_BYTE)]; + + [self btnImgAtIndex:indexPath withStr:stateString addWithOnImg:imgOnArr + addOffArr:imgOffArr]; + + } + + } -(void)setSongNuoBDControBtnImg:(NSArray *)imgOffArr diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeHelper/KTPhotoBrowser/KTPhotoScrollViewController.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeHelper/KTPhotoBrowser/KTPhotoScrollViewController.m index 03ddef3..71906f6 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeHelper/KTPhotoBrowser/KTPhotoScrollViewController.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeHelper/KTPhotoBrowser/KTPhotoScrollViewController.m @@ -510,8 +510,8 @@ const CGFloat ktkDefaultToolbarHeight = 49; UIButton *back = [UIButton buttonWithType:UIButtonTypeCustom]; back.frame = CGRectMake(0,0,48,44); - [back setImage:[UIImage imageNamed:@"arrow_l"] forState:UIControlStateNormal]; - // [_bakbutton setBackgroundImage:[UIImage imageNamed:@"arrow_l"] forState:UIControlStateNormal]; + [back setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal]; + // [_bakbutton setBackgroundImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal]; [back addTarget: self action: @selector(goBackAction) forControlEvents: UIControlEventTouchUpInside]; diff --git a/Ifish/controllers/erweima/ScanViewController.m b/Ifish/controllers/erweima/ScanViewController.m index e2bbdcd..840d56b 100644 --- a/Ifish/controllers/erweima/ScanViewController.m +++ b/Ifish/controllers/erweima/ScanViewController.m @@ -58,7 +58,7 @@ [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"blackbar.png"] forBarMetrics:UIBarMetricsDefault]; _bakbutton = [UIButton buttonWithType:UIButtonTypeCustom]; _bakbutton.frame = CGRectMake(0, 0, 47,44); - [_bakbutton setBackgroundImage:[UIImage imageNamed:@"arrow_l"] forState:UIControlStateNormal]; + [_bakbutton setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal]; [_bakbutton addTarget: self action: @selector(backButtonEvent) forControlEvents: UIControlEventTouchUpInside]; diff --git a/Ifish/controllers/leftcontrollers/ConnectHotpotViewController.h b/Ifish/controllers/leftcontrollers/ConnectHotpotViewController.h new file mode 100644 index 0000000..904af7e --- /dev/null +++ b/Ifish/controllers/leftcontrollers/ConnectHotpotViewController.h @@ -0,0 +1,16 @@ +// +// ConnectHotpotViewController.h +// Ifish +// +// Created by Minghao Xue on 2018/7/16. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import "BaseVIewContorller.h" + +@interface ConnectHotpotViewController : BaseVIewContorller + +@property (nonatomic, copy) NSString *ssid; +@property (nonatomic, copy) NSString *bssid; + +@end diff --git a/Ifish/controllers/leftcontrollers/ConnectHotpotViewController.m b/Ifish/controllers/leftcontrollers/ConnectHotpotViewController.m new file mode 100644 index 0000000..e0cfefb --- /dev/null +++ b/Ifish/controllers/leftcontrollers/ConnectHotpotViewController.m @@ -0,0 +1,299 @@ +// +// ConnectHotpotViewController.m +// Ifish +// +// Created by Minghao Xue on 2018/7/16. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import "ConnectHotpotViewController.h" +#import "ConnectHotspotTipViewController.h" +#import "dataContorl.h" +#import +#import "IFishHotpotUDPHelper.h" +#import "ESPTouchResult.h" +#import "ESPTouchTask.h" +#import "IfishDataUnity.h" +#import "MBProgressHUD.h" + +@interface ConnectHotpotViewController () +@property (weak, nonatomic) IBOutlet UIScrollView *scrollView; +@property (weak, nonatomic) IBOutlet UITextField *nameLbl; +@property (strong, nonatomic) IBOutletCollection(UIImageView) NSArray *dashView; +@property (weak, nonatomic) IBOutlet UITextField *pwdTf; +@property (weak, nonatomic) IBOutlet UIView *containerView; + +@property (nonatomic, strong) ESPTouchTask* epTask; + +@property (nonatomic, strong) NSMutableString *trackString; + +@property (nonatomic, strong) MBProgressHUD *HUD; + +/** + 设备返回的mac地址 + */ +@property (nonatomic, copy) NSString *macAddress; + +/** + 是否正在绑定设备 + */ +@property (nonatomic, assign) BOOL isBindingDevice; + +@property (nonatomic, strong) NSTimer *bindTimer; + +@property (nonatomic, assign) NSInteger retryTimes; + +@end + +@implementation ConnectHotpotViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + self.title = @"热点连接"; + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keybordframeChanged:) name:UIKeyboardDidChangeFrameNotification object:nil]; + for (UIImageView *view in self.dashView) { + view.backgroundColor = [UIColor clearColor]; + view.image = [self imageWithLineWithSize:view.frame.size]; + } + + UITapGestureRecognizer *fiveTapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(test)]; + fiveTapGesture.numberOfTapsRequired = 5; + [self.containerView addGestureRecognizer:fiveTapGesture]; +} + +- (void)test { + [UIPasteboard generalPasteboard].string = [self.trackString copy]; +} + +- (UIImage *)imageWithLineWithSize:(CGSize)size{ + CGFloat width = size.width; + UIGraphicsBeginImageContext(size); + CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound); + CGFloat lengths[] = {2,2}; + CGContextRef line = UIGraphicsGetCurrentContext(); + CGContextSetStrokeColorWithColor(line, [UIColor colorWithRed:133/255.0 green:133/255.0 blue:133/255.0 alpha:1.0].CGColor); + CGContextSetLineDash(line, 0, lengths, 1); + CGContextMoveToPoint(line, 0, 1); + CGContextAddLineToPoint(line, width-10, 1); + CGContextStrokePath(line); + return UIGraphicsGetImageFromCurrentImageContext(); +} + +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +- (void)keybordframeChanged:(NSNotification *)no { + NSDictionary *userInfo = no.userInfo; + + // 动画的持续时间 + double duration = [userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue]; + + // 键盘的frame + CGRect keyboardF = [userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue]; + keyboardF = [self.view convertRect:keyboardF fromView:[UIApplication sharedApplication].keyWindow]; + CGRect containerViewF = [self.view convertRect:self.containerView.frame fromView:self.scrollView]; + + CGFloat miniSpacing = 4; + + CGFloat offset = CGRectGetMaxY(containerViewF) + miniSpacing - CGRectGetMinY(keyboardF); + if (offset <= 0) { + offset = 0; + } + [UIView animateWithDuration:duration animations:^{ + self.scrollView.contentInset = UIEdgeInsetsMake(-offset, 0, 0, 0); + }]; +} + +- (IBAction)clickHereBtnClicked:(id)sender { + ConnectHotspotTipViewController *vc = [[ConnectHotspotTipViewController alloc] initWithNibName:@"ConnectHotspotTipViewController" bundle:nil]; + [self.navigationController pushViewController:vc animated:YES]; +} +#pragma mark - UITextFieldDelegate + +- (BOOL)textFieldShouldReturn:(UITextField *)textField { + [textField resignFirstResponder]; + return YES; +} +- (IBAction)setLinkBtnClicked:(id)sender { + if (self.nameLbl.text.length == 0) { + [self.view makeToast:@"请输入正确的路由器名称"]; + return; + } + BOOL isRight =[dataContorl isIncludeSpecialCharact:self.pwdTf.text]; + + if (!isRight) { + [self.view makeToast:@"路由器密码不能包含特殊字符,只能为数字字母下划线"]; + return; + } + + if (![[self currentWifiSSID].lowercaseString hasPrefix:@"ifish"]) { + [self.view makeToast:@"请先将手机连接到wifi:ifish-xxxx"]; + return; + } + + NSString *ssidName = self.nameLbl.text; + NSString *ssidPwd = self.pwdTf.text; + [self sendToDeviceWithSSIDName:ssidName andSSIDPWD:ssidPwd]; +} + +- (NSString *)currentWifiSSID { + NSString *ssid = @"Not Found"; + CFArrayRef myArray = CNCopySupportedInterfaces(); + if (myArray != nil) { + CFDictionaryRef myDict = CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray, 0)); + if (myDict != nil) { + NSDictionary *dict = (NSDictionary *)CFBridgingRelease(myDict); + ssid = [dict valueForKey:@"SSID"]; + } + } + return ssid; +} + +#pragma mark - UDP related + +- (void)sendToDeviceWithSSIDName:(NSString *)name andSSIDPWD:(NSString *)pwd { + [IFishHotpotUDPHelper sharedInstance].delegate = self; + [[IFishHotpotUDPHelper sharedInstance] broadCastHotspotConnectCommandWith:name pwd:pwd]; +} + +#pragma mark - IFishHotpotUDPHelperDelegate + +- (void)udpHelperCommandExecutedSuccess:(IFishUDPHelperBackMsgModel *)backModel { + self.ssid = backModel.senderMacAddress; + [self.view resignFirstResponder]; + self.HUD.labelText = @"请稍后"; + self.trackString = [NSMutableString string]; + [self appendTrakContent:@"=================收到设备答复==================="]; + [self appendTrakContent:[NSString stringWithFormat:@"答复状态码:%@", backModel.result]]; + [self appendTrakContent:[NSString stringWithFormat:@"答复Mac地址:%@", backModel.senderMacAddress]]; + self.macAddress = backModel.senderMacAddress; + + [IFishHotpotUDPHelper sharedInstance].delegate = nil; + [[IFishHotpotUDPHelper sharedInstance] broadCastRestartCommand]; + self.bindTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(startBinding) userInfo:nil repeats:YES]; +} + +- (void)startBinding { + BOOL networkOk = NO; + AFNetworkReachabilityStatus status = [AFNetworkReachabilityManager sharedManager].networkReachabilityStatus; + if (status == AFNetworkReachabilityStatusReachableViaWiFi) { + if (![[self currentWifiSSID].lowercaseString hasPrefix:@"ifish"]) { + networkOk = YES; + } + } else if (status == AFNetworkReachabilityStatusReachableViaWWAN) { + networkOk = YES; + } + if (!networkOk) { + return; + } + if (self.isBindingDevice) { + return; + } + if (self.macAddress.length == 0) { + return; + } + self.isBindingDevice = YES; + if (self.bindTimer) { + [self.bindTimer invalidate]; + self.bindTimer = nil; + } + self.retryTimes = 0; + [self bindDeviceWithSsid:self.macAddress]; +} + +- (void)udpHelperMessage:(NSString *)msg { + self.HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES]; + self.HUD.mode = MBProgressHUDModeIndeterminate; + self.HUD.labelText = msg; +} + +#pragma mark - bind +-(void)bindDeviceWithSsid:(NSString*)bssid{ + NSLog(@"设备bssid_%@",bssid); + [self appendTrakContent:@"=================进入绑定函数================="]; + NSString *userId = [dataContorl dataControlGetUserIdInfo]; + self.HUD.labelText = @"正在绑定设备"; + [self appendTrakContent:[NSString stringWithFormat:@"绑定参数 userID:%@", userId]]; + [self appendTrakContent:[NSString stringWithFormat:@"绑定参数 macaddress:%@", bssid]]; + [AFHttpTool bindDeviceWithUserId:userId macAddress:bssid success:^(id response) { + self.isBindingDevice = NO; + self.macAddress = nil; + NSDictionary*resultDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil]; + NSLog(@"data:%@",resultDic[@"data"]); + [self appendTrakContent:[NSString stringWithFormat:@"绑定请求成功。返回数据为:%@", resultDic]]; + if ([resultDic[@"result"] isEqualToString:@"100"]) { + + // 保存设备信息 + NSDictionary*dataDic=resultDic[@"data"]; + DeviceModel*devicemodel=[[DeviceModel alloc] initWithDict:dataDic]; + [self appendTrakContent:[NSString stringWithFormat:@"绑定返回状态码正确。设备信息为:%@", dataDic]]; + + if (!devicemodel.type){ + self.HUD.labelText = @"用户绑定设备成功,但设备初次入网失败请重新登陆"; + + }else{ + NSMutableArray * _deviceArry=[[DataCenter defaultDtacenter]valueForKey:@"deviceInfo"]; + + [_deviceArry insertObject:devicemodel atIndex:0]; + + [[DataCenter defaultDtacenter]setValue:_deviceArry forKey:@"deviceInfo"]; + + if ([devicemodel.type isEqual:[NSNull null]]){ + + //进入此循环 可能因为设备所在服务器 不在 本程序所在 服务器 + self.HUD.labelText = @"设备不在服务器"; + + }else{ + self.HUD.labelText = @"设备绑定成功"; + [[IfishDataUnity shareDataInstance] initAppCenterVcWith:devicemodel addWithdissMisVc:nil]; + + //绑定成功 加 经验值 + [[IfishUserObsever sharedInstance] xinZengJingYanZhi:IFISHADDEXP_BIDDEVICE addType:IFISHADDEXPTYPE1]; + } + } + + }else if ([resultDic[@"result"] isEqualToString:@"101"]){ + [self appendTrakContent:@"绑定返回状态码错误。设备信息为:%@"]; + self.HUD.labelText = @"绑定失败"; + self.bakbutton.userInteractionEnabled=YES; + + }else if ([resultDic[@"result"] isEqualToString:@"301"]){ + [self appendTrakContent:@"绑定返回状态码错误。设备信息为:%@"]; + + self.HUD.labelText = @"请求验证失败,请重新登录"; + self.bakbutton.userInteractionEnabled=YES; + }else if ([resultDic[@"result"] isEqualToString:@"302"]){ + // 请求被舍弃未执行 + [self appendTrakContent:@"绑定返回状态码错误。设备信息为:%@"]; + + self.bakbutton.userInteractionEnabled=YES; + self.HUD.labelText = @"绑定失败"; + [self.HUD hide:YES afterDelay:2]; + } + + + } failure:^(NSError *err) { + if (self.retryTimes < 3) { + [self bindDeviceWithSsid:self.macAddress]; + self.retryTimes += 1; + } else { + self.isBindingDevice = NO; + self.HUD.labelText = @"请求异常"; + [self.HUD hide:YES afterDelay:2]; + [self appendTrakContent:[NSString stringWithFormat:@"绑定网络请求错误:%@", err.localizedDescription]]; + self.bakbutton.userInteractionEnabled=YES; + } + }]; + +} + +#pragma mark - Private + +- (void)appendTrakContent:(NSString *)msg { + [self.trackString appendString:msg]; + [self.trackString appendString:@"\n"]; +} + +@end diff --git a/Ifish/controllers/leftcontrollers/ConnectHotpotViewController.xib b/Ifish/controllers/leftcontrollers/ConnectHotpotViewController.xib new file mode 100644 index 0000000..00ed8b8 --- /dev/null +++ b/Ifish/controllers/leftcontrollers/ConnectHotpotViewController.xib @@ -0,0 +1,207 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ifish/controllers/leftcontrollers/ConnectHotspotModel.h b/Ifish/controllers/leftcontrollers/ConnectHotspotModel.h new file mode 100644 index 0000000..9b914a7 --- /dev/null +++ b/Ifish/controllers/leftcontrollers/ConnectHotspotModel.h @@ -0,0 +1,16 @@ +// +// ConnectHotspotModel.h +// Ifish +// +// Created by Minghao Xue on 2018/8/6. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import "baseModel.h" + +@interface ConnectHotspotModel : baseModel + +@property (nonatomic, copy) NSString *ssidName; +@property (nonatomic, copy) NSString *pwd; + +@end diff --git a/Ifish/controllers/leftcontrollers/ConnectHotspotModel.m b/Ifish/controllers/leftcontrollers/ConnectHotspotModel.m new file mode 100644 index 0000000..ccbb79c --- /dev/null +++ b/Ifish/controllers/leftcontrollers/ConnectHotspotModel.m @@ -0,0 +1,50 @@ +// +// ConnectHotspotModel.m +// Ifish +// +// Created by Minghao Xue on 2018/8/6. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import "ConnectHotspotModel.h" + +@implementation ConnectHotspotModel + +- (NSString *)description{ + + self.messagetype=@"00"; + self.massagelegth=@"39"; + self.functionCode=@"12"; + self.sendmacId = @"000000000000"; + self.resavemacId = @"000000000000"; + + return [NSString stringWithFormat:@"%@%@%@%@%@%@%@%@", self.messagetype,self.functionCode,self.sendmacId,self.resavemacId,self.massagelegth,[self zeroLeftPadding:[dataContorl hexStringFromString:self.ssidName]], [self zeroLeftPadding:[dataContorl hexStringFromString:self.pwd]],[self crcCode]]; +} + +- (NSString *)ssidName { + return [NSString stringWithFormat:@"%@\0", _ssidName]; +} + +- (NSString *)pwd { + return [NSString stringWithFormat:@"%@\0", _pwd]; +} + +- (NSString *)zeroLeftPadding:(NSString *)origin { + if (origin.length >= 40) { + return [origin substringToIndex:40]; + } else { + NSInteger left = 40 - origin.length; + NSMutableString *str = [NSMutableString string]; + [str appendString:origin]; + for (NSInteger index = 0; index < left; index++) { + [str appendString:@"0"]; + } + return [str copy]; + } +} + +- (NSString *)crcCode { + return @"0000"; +} + +@end diff --git a/Ifish/controllers/leftcontrollers/ConnectHotspotTipViewController.h b/Ifish/controllers/leftcontrollers/ConnectHotspotTipViewController.h new file mode 100644 index 0000000..639412d --- /dev/null +++ b/Ifish/controllers/leftcontrollers/ConnectHotspotTipViewController.h @@ -0,0 +1,13 @@ +// +// ConnectHotspotTipViewController.h +// Ifish +// +// Created by Minghao Xue on 2018/7/22. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import "BaseVIewContorller.h" + +@interface ConnectHotspotTipViewController : BaseVIewContorller + +@end diff --git a/Ifish/controllers/leftcontrollers/ConnectHotspotTipViewController.m b/Ifish/controllers/leftcontrollers/ConnectHotspotTipViewController.m new file mode 100644 index 0000000..ce19e6e --- /dev/null +++ b/Ifish/controllers/leftcontrollers/ConnectHotspotTipViewController.m @@ -0,0 +1,23 @@ +// +// ConnectHotspotTipViewController.m +// Ifish +// +// Created by Minghao Xue on 2018/7/22. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import "ConnectHotspotTipViewController.h" + +@interface ConnectHotspotTipViewController () + +@end + +@implementation ConnectHotspotTipViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + self.title = @"ifish7热点连接"; + +} + +@end diff --git a/Ifish/controllers/leftcontrollers/ConnectHotspotTipViewController.xib b/Ifish/controllers/leftcontrollers/ConnectHotspotTipViewController.xib new file mode 100644 index 0000000..15ebe93 --- /dev/null +++ b/Ifish/controllers/leftcontrollers/ConnectHotspotTipViewController.xib @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ifish/controllers/leftcontrollers/IFishHotpotUDPHelper.h b/Ifish/controllers/leftcontrollers/IFishHotpotUDPHelper.h new file mode 100644 index 0000000..fdbdaeb --- /dev/null +++ b/Ifish/controllers/leftcontrollers/IFishHotpotUDPHelper.h @@ -0,0 +1,33 @@ +// +// IfishUDPBroadCastHelper.h +// Ifish +// +// Created by imac on 16/9/12. +// Copyright © 2016年 lianxiang. All rights reserved. +// + +#import +#import "AsyncUdpSocket.h" +#import "IFishUDPHelperBackMsgModel.h" + +@protocol IFishHotpotUDPHelperDelegate + +@optional +- (void)udpHelperMessage:(NSString *)msg; +- (void)udpHelperCommandExecutedSuccess:(IFishUDPHelperBackMsgModel *)backModel; + +@end + +@interface IFishHotpotUDPHelper : NSObject + +@property (nonatomic, strong) AsyncUdpSocket *clientSocket; + ++ (IFishHotpotUDPHelper *)sharedInstance; + +@property (nonatomic, weak) id delegate; + +- (void)broadCastHotspotConnectCommandWith:(NSString *)ssidName pwd:(NSString *)pwd; +- (void)broadCastRestartCommand; +- (void)broadCastRestCommand; + +@end diff --git a/Ifish/controllers/leftcontrollers/IFishHotpotUDPHelper.m b/Ifish/controllers/leftcontrollers/IFishHotpotUDPHelper.m new file mode 100644 index 0000000..960ba1c --- /dev/null +++ b/Ifish/controllers/leftcontrollers/IFishHotpotUDPHelper.m @@ -0,0 +1,185 @@ +// +// IfishUDPBroadCastHelper.m +// Ifish +// +// Created by imac on 16/9/12. +// Copyright © 2016年 lianxiang. All rights reserved. +// + +#import "IFishHotpotUDPHelper.h" +#import "LxGetCurrentIp.h" +#import "AppDelegate.h" +#import "ConnectHotspotModel.h" +#import "ResetDeviceModel.h" +#import "RestartDeviceModel.h" + +#define K_ReSendTimeInterval 3 + +@interface IFishHotpotUDPHelper () +{ + NSString * _ssidName; + NSString *_pwd; +} + +@property (nonatomic, strong) NSTimer *loopTimer; + +@property (nonatomic, assign) int tag; + +@end + + +@implementation IFishHotpotUDPHelper + ++ (IFishHotpotUDPHelper *)sharedInstance{ + + static IFishHotpotUDPHelper *sharedInstace = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedInstace = [[self alloc] init]; + }); + return sharedInstace; +} + +- (instancetype)init { + if (self = [super init]) { + self.clientSocket = [[AsyncUdpSocket alloc] initWithDelegate:self]; + + UInt16 bindPort = 9954; + + NSError *error; + //本地接收端口 + [self.clientSocket bindToPort:bindPort error:&error]; + } + return self; +} + +- (void)loopTimerTick { + if (self.tag == 0) { + [self sendConnectHotspotSoketdata]; + } else if (self.tag == 1) { + [self sendRestartSocketData]; + } else if (self.tag == 2) { + [self sendResetSocketData]; + } +} + +- (void)startLoopTimer { + self.loopTimer = [NSTimer scheduledTimerWithTimeInterval:K_ReSendTimeInterval target:self selector:@selector(loopTimerTick) userInfo:nil repeats:YES]; +} + +- (void)broadCastHotspotConnectCommandWith:(NSString *)ssidName pwd:(NSString *)pwd { + _ssidName = ssidName; + _pwd = pwd; + [self postmsg:@"命令已发出"]; + [self sendConnectHotspotSoketdata]; + [self startLoopTimer]; +} + +- (void)broadCastRestCommand { + [self postmsg:@"命令已发出"]; + [self sendResetSocketData]; + [self startLoopTimer]; +} + +- (void)sendResetSocketData { + NSString* hostS = @"192.168.4.1"; + ResetDeviceModel *model = [ResetDeviceModel new]; + NSString *request=[NSString stringWithFormat:@"%@", model.description]; + + NSData *data=[dataContorl stringToHexData:request]; + + UInt16 port = 333; + self.tag = 2; + [self.clientSocket receiveWithTimeout:-1 tag:self.tag]; + + [self.clientSocket sendData:data toHost:hostS port:port withTimeout:-1 tag:self.tag]; +} + +- (void)broadCastRestartCommand { + [self postmsg:@"命令已发出"]; + [self sendRestartSocketData]; + [self startLoopTimer]; +} + +- (void)sendRestartSocketData { + NSString* hostS = @"192.168.4.1"; + //120.55.190.56 服务器IP 指令中用 + RestartDeviceModel *model = [RestartDeviceModel new]; + NSString *request=[NSString stringWithFormat:@"%@", model.description]; + + NSData *data=[dataContorl stringToHexData:request]; + + UInt16 port = 333; + self.tag = 1; + [self.clientSocket receiveWithTimeout:-1 tag:self.tag]; + + [self.clientSocket sendData:data toHost:hostS port:port withTimeout:-1 tag:self.tag]; +} + +-(void)sendConnectHotspotSoketdata{ + NSString* hostS = @"192.168.4.1"; + + //120.55.190.56 服务器IP 指令中用 + ConnectHotspotModel *model = [ConnectHotspotModel new]; + model.ssidName = _ssidName; + model.pwd = _pwd; + NSString *request=[NSString stringWithFormat:@"%@", model.description]; + + NSData *data=[dataContorl stringToHexData:request]; + + UInt16 port = 333; + self.tag = 0; + [self.clientSocket receiveWithTimeout:-1 tag:self.tag]; + + [self.clientSocket sendData:data toHost:hostS port:port withTimeout:-1 tag:self.tag]; +} + +-(BOOL)onUdpSocket:(AsyncUdpSocket *)sock didReceiveData:(NSData *)data withTag:(long)tag fromHost:(NSString *)host port:(UInt16)port +{ + [self.loopTimer invalidate]; + self.loopTimer = nil; + + NSString* result = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; + IFishUDPHelperBackMsgModel *model = [[IFishUDPHelperBackMsgModel alloc] initWithData:data]; + if ([model.result isEqualToString:@"01"]) { + if ([self.delegate respondsToSelector:@selector(udpHelperCommandExecutedSuccess:)]) { + [self.delegate udpHelperCommandExecutedSuccess:model]; + } + } else { + AppDelegate *app =(AppDelegate*)[UIApplication sharedApplication].delegate; + [app.window makeToast:[NSString stringWithFormat:@"收到答复:%@", result]]; + } + return YES; + +} + +-(void)onUdpSocketDidClose:(AsyncUdpSocket *)sock{ + NSLog(@"关闭"); +} + + +-(void)onUdpSocket:(AsyncUdpSocket *)sock didSendDataWithTag:(long)tag{ + + NSLog(@"didSendData"); +} + + +-(void)onUdpSocket:(AsyncUdpSocket *)sock didNotReceiveDataWithTag:(long)tag dueToError:(NSError *)error{ + + NSLog(@"dueToError%@",error); + [self postmsg:error.localizedDescription]; +} + + +-(void)dealloc{ + + [self.clientSocket close]; +} + +- (void)postmsg:(NSString *)msg { + if ([self.delegate respondsToSelector:@selector(udpHelperMessage:)]) { + [self.delegate udpHelperMessage:msg]; + } +} + +@end diff --git a/Ifish/controllers/leftcontrollers/IFishUDPHelperBackMsgModel.h b/Ifish/controllers/leftcontrollers/IFishUDPHelperBackMsgModel.h new file mode 100644 index 0000000..3158168 --- /dev/null +++ b/Ifish/controllers/leftcontrollers/IFishUDPHelperBackMsgModel.h @@ -0,0 +1,20 @@ +// +// IFishUDPHelperBackMsgModel.h +// Ifish +// +// Created by Minghao Xue on 2018/8/6. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import + +@interface IFishUDPHelperBackMsgModel : NSObject + +@property (nonatomic, copy) NSString *senderMacAddress; +@property (nonatomic, copy) NSString *result; +@property (nonatomic, copy) NSString *changshang; +@property (nonatomic, copy) NSString *device; + +- (instancetype)initWithData:(NSData *)data; + +@end diff --git a/Ifish/controllers/leftcontrollers/IFishUDPHelperBackMsgModel.m b/Ifish/controllers/leftcontrollers/IFishUDPHelperBackMsgModel.m new file mode 100644 index 0000000..38fe3e5 --- /dev/null +++ b/Ifish/controllers/leftcontrollers/IFishUDPHelperBackMsgModel.m @@ -0,0 +1,24 @@ +// +// IFishUDPHelperBackMsgModel.m +// Ifish +// +// Created by Minghao Xue on 2018/8/6. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import "IFishUDPHelperBackMsgModel.h" + +@implementation IFishUDPHelperBackMsgModel + +- (instancetype)initWithData:(NSData *)data { + if (self = [super init]) { + NSString*totalString=[dataContorl dataToHexString:data]; + self.senderMacAddress = [totalString substringWithRange:NSMakeRange(4, 12)]; + self.result = [totalString substringWithRange:NSMakeRange(30, 2)]; + self.changshang = [totalString substringWithRange:NSMakeRange(32, 2)]; + self.device = [totalString substringWithRange:NSMakeRange(34, 2)]; + } + return self; +} + +@end diff --git a/Ifish/controllers/leftcontrollers/ResetDeviceModel.h b/Ifish/controllers/leftcontrollers/ResetDeviceModel.h new file mode 100644 index 0000000..d1ff31c --- /dev/null +++ b/Ifish/controllers/leftcontrollers/ResetDeviceModel.h @@ -0,0 +1,13 @@ +// +// ResetDeviceModel.h +// Ifish +// +// Created by Minghao Xue on 2018/8/6. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import "baseModel.h" + +@interface ResetDeviceModel : baseModel + +@end diff --git a/Ifish/controllers/leftcontrollers/ResetDeviceModel.m b/Ifish/controllers/leftcontrollers/ResetDeviceModel.m new file mode 100644 index 0000000..194a252 --- /dev/null +++ b/Ifish/controllers/leftcontrollers/ResetDeviceModel.m @@ -0,0 +1,28 @@ +// +// ResetDeviceModel.m +// Ifish +// +// Created by Minghao Xue on 2018/8/6. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import "ResetDeviceModel.h" + +@implementation ResetDeviceModel + +- (NSString *)description{ + + self.messagetype=@"00"; + self.massagelegth=@"00"; + self.functionCode=@"13"; + self.sendmacId = @"000000000000"; + self.resavemacId = @"000000000000"; + + return [NSString stringWithFormat:@"%@%@%@%@%@%@", self.messagetype,self.functionCode,self.sendmacId,self.resavemacId,self.massagelegth,[self crcCode]]; +} + +- (NSString *)crcCode { + return @"0000"; +} + +@end diff --git a/Ifish/controllers/leftcontrollers/RestartDeviceModel.h b/Ifish/controllers/leftcontrollers/RestartDeviceModel.h new file mode 100644 index 0000000..3a0a587 --- /dev/null +++ b/Ifish/controllers/leftcontrollers/RestartDeviceModel.h @@ -0,0 +1,13 @@ +// +// RestartDeviceModel.h +// Ifish +// +// Created by Minghao Xue on 2018/8/6. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import "baseModel.h" + +@interface RestartDeviceModel : baseModel + +@end diff --git a/Ifish/controllers/leftcontrollers/RestartDeviceModel.m b/Ifish/controllers/leftcontrollers/RestartDeviceModel.m new file mode 100644 index 0000000..b488d08 --- /dev/null +++ b/Ifish/controllers/leftcontrollers/RestartDeviceModel.m @@ -0,0 +1,28 @@ +// +// RestartDeviceModel.m +// Ifish +// +// Created by Minghao Xue on 2018/8/6. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import "RestartDeviceModel.h" + +@implementation RestartDeviceModel + +- (NSString *)description{ + + self.messagetype=@"00"; + self.massagelegth=@"11"; + self.functionCode=@"14"; + self.sendmacId = @"000000000000"; + self.resavemacId = @"000000000000"; + + return [NSString stringWithFormat:@"%@%@%@%@%@%@", self.messagetype,self.functionCode,self.sendmacId,self.resavemacId,self.massagelegth,[self crcCode]]; +} + +- (NSString *)crcCode { + return @"0000"; +} + +@end diff --git a/Ifish/controllers/leftcontrollers/SecondConnectWifiController.h b/Ifish/controllers/leftcontrollers/SecondConnectWifiController.h index 455e5be..e4b23e7 100644 --- a/Ifish/controllers/leftcontrollers/SecondConnectWifiController.h +++ b/Ifish/controllers/leftcontrollers/SecondConnectWifiController.h @@ -16,6 +16,7 @@ - (IBAction)makeSureButton:(id)sender; +- (IBAction)lickHereBtnClicked:(id)sender; @property(nonatomic,strong)NSString*ssid; @property(nonatomic,strong)NSString*bssid; @@ -25,6 +26,8 @@ @property (weak, nonatomic) IBOutlet UIButton *shuoMingShuBtn; @property (weak, nonatomic) IBOutlet UIImageView *nodImg; +@property (weak, nonatomic) IBOutlet UILabel *connectTipLbl; +@property (weak, nonatomic) IBOutlet UIButton *connectBtn; @end diff --git a/Ifish/controllers/leftcontrollers/SecondConnectWifiController.m b/Ifish/controllers/leftcontrollers/SecondConnectWifiController.m index 2e0d000..dcb40eb 100644 --- a/Ifish/controllers/leftcontrollers/SecondConnectWifiController.m +++ b/Ifish/controllers/leftcontrollers/SecondConnectWifiController.m @@ -27,6 +27,9 @@ #import "IfishConnectingView.h" #import "PushMasssageWebViewController.h" #import "IfishUserObsever.h" + +#import "ConnectHotpotViewController.h" + @interface EspTouchDelegateImpl : NSObject @end @@ -96,6 +99,7 @@ extern BOOL isfromCameraView; self.view.backgroundColor=[UIColor whiteColor]; _deviceArry =[[NSMutableArray alloc]init]; + [self updateUI]; [self getSSid]; //输入框在上面新UI 可去 @@ -136,6 +140,19 @@ extern BOOL isfromCameraView; [self creatConnectStateUI]; } +- (void)updateUI { + CGFloat yOffset = 0; + if (is_iPhone_X) { + yOffset = 20 + 88; + } else { + yOffset = 20 + 64; + } + self.nodImg.frame = CGRectMake(12, yOffset, 10, 10); + self.wifiNamelabel.frame = CGRectMake(23, yOffset - 18 + 5, 336, 36); + [self.view bringSubviewToFront:self.connectTipLbl]; + [self.view bringSubviewToFront:self.connectBtn]; +} + -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; @@ -169,8 +186,14 @@ extern BOOL isfromCameraView; { if (!self.connectingView) { + CGFloat yOffset = 0; + if (is_iPhone_X) { + yOffset = 88; + } else { + yOffset = 64; + } - IfishConnectingView *connectingView=[[IfishConnectingView alloc] initWithFrame:CGRectMake(0,64, kScreenSize.width, CGRectGetMaxY(self.wifiTextFiled.frame))]; + IfishConnectingView *connectingView=[[IfishConnectingView alloc] initWithFrame:CGRectMake(0,yOffset, kScreenSize.width, CGRectGetMaxY(self.wifiTextFiled.frame))]; self.connectingView =connectingView; @@ -180,6 +203,8 @@ extern BOOL isfromCameraView; [self.view addSubview:connectingView]; self.wifiNamelabel.hidden = NO; self.wifiTextFiled.hidden = NO; + self.connectTipLbl.hidden = NO; + self.connectBtn.hidden = NO; self.shareButton.hidden = NO; self.nodImg.hidden = NO; @@ -195,6 +220,8 @@ extern BOOL isfromCameraView; [self.connectingView.textChangeView stopAnimation]; self.wifiNamelabel.hidden = NO; self.wifiTextFiled.hidden = NO; + self.connectTipLbl.hidden = NO; + self.connectBtn.hidden = NO; self.shareButton.hidden = NO; self.nodImg.hidden = NO; @@ -220,6 +247,8 @@ extern BOOL isfromCameraView; self.wifiNamelabel.hidden = YES; self.wifiTextFiled.hidden = YES; + self.connectTipLbl.hidden = YES; + self.connectBtn.hidden = YES; self.shareButton.hidden = YES; self.nodImg.hidden = YES; @@ -388,6 +417,13 @@ extern BOOL isfromCameraView; } +- (IBAction)lickHereBtnClicked:(id)sender { + ConnectHotpotViewController *vc = [[ConnectHotpotViewController alloc] initWithNibName:@"ConnectHotpotViewController" bundle:nil]; + vc.ssid = self.ssid; + vc.bssid = self.bssid; + [self.navigationController pushViewController:vc animated:YES]; +} + - (IBAction)commandbackBtn:(id)sender { SaySomethingViewController*say=[[SaySomethingViewController alloc]init]; [self.navigationController pushViewController:say animated:YES]; diff --git a/Ifish/controllers/leftcontrollers/SecondConnectWifiController.xib b/Ifish/controllers/leftcontrollers/SecondConnectWifiController.xib index 56198d6..8706e73 100644 --- a/Ifish/controllers/leftcontrollers/SecondConnectWifiController.xib +++ b/Ifish/controllers/leftcontrollers/SecondConnectWifiController.xib @@ -1,16 +1,18 @@ - - + + - + + + @@ -33,6 +35,22 @@ + + @@ -79,9 +97,4 @@ - - - - - diff --git a/Ifish/controllers/leftcontrollers/tip.png b/Ifish/controllers/leftcontrollers/tip.png new file mode 100644 index 0000000..2d7b3ca Binary files /dev/null and b/Ifish/controllers/leftcontrollers/tip.png differ diff --git a/Ifish/controllers/logAddRegistController/RegistViewController.mm b/Ifish/controllers/logAddRegistController/RegistViewController.mm index ea851d2..5606235 100644 --- a/Ifish/controllers/logAddRegistController/RegistViewController.mm +++ b/Ifish/controllers/logAddRegistController/RegistViewController.mm @@ -60,6 +60,8 @@ @property(nonatomic) double latitude; @property(nonatomic,copy) NSString *adderss; +@property (weak, nonatomic) IBOutlet UILabel *qrcodeSwitchLbl; + @end extern BOOL formLogIn; @@ -133,12 +135,21 @@ extern BOOL formLogIn; //NSString *zone = [dataContorl areaCode:self.phoneNumberTextField.text]; //self.areaCode = zone; - - [IFISHHTTPTOOL getverifyWithTimerButton:_timeBtn addphoneNumber:self.phoneNumberTextField.text zone:self.areaCode result:^(NSError *err) { + BOOL isTextCode = [[self.timeBtn titleForState:UIControlStateNormal] isEqualToString:@"短信验证码"]; + [IFISHHTTPTOOL getverifyWithTimerButton:_timeBtn addphoneNumber:self.phoneNumberTextField.text zone:self.areaCode isTextCode:isTextCode result:^(NSError *err) { }]; } +- (IBAction)qrcodeSwithBtnClicked:(UIButton *)sender { + if ([[self.timeBtn titleForState:UIControlStateNormal] isEqualToString:@"语音验证码"]) { + [self.timeBtn setTitle:@"短信验证码" forState:UIControlStateNormal]; + self.qrcodeSwitchLbl.text = @"语音验证码"; + } else if ([[self.timeBtn titleForState:UIControlStateNormal] isEqualToString:@"短信验证码"]) { + [self.timeBtn setTitle:@"语音验证码" forState:UIControlStateNormal]; + self.qrcodeSwitchLbl.text = @"短信验证码"; + } +} #pragma mark-设置键盘样式 -(void)setTextkeyboadType{ @@ -559,11 +570,14 @@ extern BOOL formLogIn; NSMutableArray * imageNames = [NSMutableArray array]; for (int i=1; i<=3; i++) { - [imageNames addObject:[NSString stringWithFormat:@"introlImage_%d",i]]; - + if (is_iPhone_X) { + [imageNames addObject:[NSString stringWithFormat:@"introlImage_iphonex_%d.jpg",i]]; + } else { + [imageNames addObject:[NSString stringWithFormat:@"introlImage_%d.png",i]]; + } } - introductionVC.imageNames=imageNames; + introductionVC.imageNames=imageNames; introductionVC.hiddenPageControl=NO; introductionVC.introductionStyle=LXIntroductionStyleFullScreenGoButton; introductionVC.goActionCallBack=^(MyIntroductionViewController* intrVC){ diff --git a/Ifish/controllers/logAddRegistController/RegistViewController.xib b/Ifish/controllers/logAddRegistController/RegistViewController.xib index 570b807..102f191 100644 --- a/Ifish/controllers/logAddRegistController/RegistViewController.xib +++ b/Ifish/controllers/logAddRegistController/RegistViewController.xib @@ -1,11 +1,11 @@ - + - + @@ -16,6 +16,7 @@ + @@ -118,7 +119,7 @@ - @@ -173,20 +187,25 @@ + + + + + @@ -195,6 +214,7 @@ + diff --git a/Ifish/ifishImgSouce/NewLeftRightAddBack/back_btn@2x.png b/Ifish/ifishImgSouce/NewLeftRightAddBack/back_btn@2x.png new file mode 100644 index 0000000..c8e76b4 Binary files /dev/null and b/Ifish/ifishImgSouce/NewLeftRightAddBack/back_btn@2x.png differ diff --git a/Ifish/ifishImgSouce/NewLeftRightAddBack/back_btn_1@2x.png b/Ifish/ifishImgSouce/NewLeftRightAddBack/back_btn_1@2x.png new file mode 100644 index 0000000..7f574c9 Binary files /dev/null and b/Ifish/ifishImgSouce/NewLeftRightAddBack/back_btn_1@2x.png differ diff --git a/Ifish/ifishImgSouce/NewPiFubtn/JiaReBang.png b/Ifish/ifishImgSouce/NewPiFubtn/JiaReBang.png new file mode 100644 index 0000000..d66fa35 Binary files /dev/null and b/Ifish/ifishImgSouce/NewPiFubtn/JiaReBang.png differ diff --git a/Ifish/ifishImgSouce/ifishWodeImgs/setting-reset.png b/Ifish/ifishImgSouce/ifishWodeImgs/setting-reset.png new file mode 100644 index 0000000..36c5e40 Binary files /dev/null and b/Ifish/ifishImgSouce/ifishWodeImgs/setting-reset.png differ diff --git a/Ifish/ifishImgSouce/ifishWodeImgs/setting-reset@2x.png b/Ifish/ifishImgSouce/ifishWodeImgs/setting-reset@2x.png new file mode 100644 index 0000000..b36b799 Binary files /dev/null and b/Ifish/ifishImgSouce/ifishWodeImgs/setting-reset@2x.png differ diff --git a/Ifish/ifishImgSouce/ifishWodeImgs/setting-reset@3x.png b/Ifish/ifishImgSouce/ifishWodeImgs/setting-reset@3x.png new file mode 100644 index 0000000..406cf30 Binary files /dev/null and b/Ifish/ifishImgSouce/ifishWodeImgs/setting-reset@3x.png differ diff --git a/Ifish/ifishImgSouce/ifishWodeImgs/setting-restart.png b/Ifish/ifishImgSouce/ifishWodeImgs/setting-restart.png new file mode 100644 index 0000000..79ae48e Binary files /dev/null and b/Ifish/ifishImgSouce/ifishWodeImgs/setting-restart.png differ diff --git a/Ifish/ifishImgSouce/ifishWodeImgs/setting-restart@2x.png b/Ifish/ifishImgSouce/ifishWodeImgs/setting-restart@2x.png new file mode 100644 index 0000000..f40b8c8 Binary files /dev/null and b/Ifish/ifishImgSouce/ifishWodeImgs/setting-restart@2x.png differ diff --git a/Ifish/ifishImgSouce/ifishWodeImgs/setting-restart@3x.png b/Ifish/ifishImgSouce/ifishWodeImgs/setting-restart@3x.png new file mode 100644 index 0000000..27f1b34 Binary files /dev/null and b/Ifish/ifishImgSouce/ifishWodeImgs/setting-restart@3x.png differ diff --git a/Ifish/ifishImgSouce/introductionImage/introlImage_iphonex_1.jpg b/Ifish/ifishImgSouce/introductionImage/introlImage_iphonex_1.jpg new file mode 100644 index 0000000..d4ab6c4 Binary files /dev/null and b/Ifish/ifishImgSouce/introductionImage/introlImage_iphonex_1.jpg differ diff --git a/Ifish/ifishImgSouce/introductionImage/introlImage_iphonex_2.jpg b/Ifish/ifishImgSouce/introductionImage/introlImage_iphonex_2.jpg new file mode 100644 index 0000000..9483df6 Binary files /dev/null and b/Ifish/ifishImgSouce/introductionImage/introlImage_iphonex_2.jpg differ diff --git a/Ifish/ifishImgSouce/introductionImage/introlImage_iphonex_3.jpg b/Ifish/ifishImgSouce/introductionImage/introlImage_iphonex_3.jpg new file mode 100644 index 0000000..ae666a5 Binary files /dev/null and b/Ifish/ifishImgSouce/introductionImage/introlImage_iphonex_3.jpg differ diff --git a/Ifish/views/introductionView/MyIntroductionViewController.m b/Ifish/views/introductionView/MyIntroductionViewController.m index 485ecd1..7478ccd 100644 --- a/Ifish/views/introductionView/MyIntroductionViewController.m +++ b/Ifish/views/introductionView/MyIntroductionViewController.m @@ -94,21 +94,18 @@ static MyIntroductionViewController * introduction = nil; } -(void)setUpScrollView{ - self.scrollView.contentSize = CGSizeMake(self.scrollView.bounds.size.width*self.imageNames.count, self.scrollView.bounds.size.height); + CGFloat width = CGRectGetWidth([UIScreen mainScreen].bounds); + CGFloat height = CGRectGetHeight([UIScreen mainScreen].bounds); + self.scrollView.contentSize = CGSizeMake(width * self.imageNames.count, height); self.scrollView.bounces=NO; //views for (int i=0; iself.scrollView.frame.size.width) { - frame.size.width = self.scrollView.bounds.size.width; - frame.size.height = frame.size.width * oldH / oldW; - imgV.frame = frame; - } - imgV.center = CGPointMake((i+0.5)*self.scrollView.bounds.size.width, self.scrollView.bounds.size.height/2); + imgV.contentMode = UIViewContentModeScaleAspectFit; + imgV.layer.masksToBounds = YES; + CGFloat x = i * width; + imgV.frame = CGRectMake(x, 0, width, height); [self.scrollView addSubview:imgV]; [self.imageViews addObject:imgV]; } diff --git a/Ifish/views/setViewCell/CustomModeSetCell.h b/Ifish/views/setViewCell/CustomModeSetCell.h new file mode 100644 index 0000000..a59f381 --- /dev/null +++ b/Ifish/views/setViewCell/CustomModeSetCell.h @@ -0,0 +1,17 @@ +// +// CustomModeSetCell.h +// Ifish +// +// Created by Minghao Xue on 2018/4/22. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import + +@interface CustomModeSetCell : UITableViewCell + +@property (weak, nonatomic) IBOutlet UILabel *customModeTitleLbl; + +@property (weak, nonatomic) IBOutlet UIButton *switchControl; + +@end diff --git a/Ifish/views/setViewCell/CustomModeSetCell.m b/Ifish/views/setViewCell/CustomModeSetCell.m new file mode 100644 index 0000000..dab1c88 --- /dev/null +++ b/Ifish/views/setViewCell/CustomModeSetCell.m @@ -0,0 +1,33 @@ +// +// CustomModeSetCell.m +// Ifish +// +// Created by Minghao Xue on 2018/4/22. +// Copyright © 2018年 lianlian. All rights reserved. +// + +#import "CustomModeSetCell.h" + +@implementation CustomModeSetCell + +- (void)awakeFromNib { + // Initialization code + self.backgroundView=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"set_cellBack"]]; + UIView *clearView=[[UIView alloc] init]; + clearView.backgroundColor=[UIColor clearColor]; + clearView.frame=self.bounds; + + self.customModeTitleLbl.font = [UIFont systemFontOfSize:15]; + [self.customModeTitleLbl sizeToFit]; + + [self setSelectedBackgroundView:clearView]; + +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/Ifish/views/setViewCell/CustomModeSetCell.xib b/Ifish/views/setViewCell/CustomModeSetCell.xib new file mode 100644 index 0000000..ec28fbb --- /dev/null +++ b/Ifish/views/setViewCell/CustomModeSetCell.xib @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ifish/views/setViewCell/TemperatureSetCell.xib b/Ifish/views/setViewCell/TemperatureSetCell.xib index 6dfcc7c..e5e9bf1 100644 --- a/Ifish/views/setViewCell/TemperatureSetCell.xib +++ b/Ifish/views/setViewCell/TemperatureSetCell.xib @@ -1,9 +1,13 @@ - - + + + + + - + + @@ -12,32 +16,32 @@ - + diff --git a/fastlane/Appfile b/fastlane/Appfile new file mode 100644 index 0000000..cccb41e --- /dev/null +++ b/fastlane/Appfile @@ -0,0 +1,8 @@ +app_identifier("com.shyuying.Ifish8") # The bundle identifier of your app +apple_id("fun@ifish7.com") # Your Apple email address + +itc_team_id("118234974") # App Store Connect Team ID +team_id("WFX8GD5HFX") # Developer Portal Team ID + +# For more information about the Appfile, see: +# https://docs.fastlane.tools/advanced/#appfile diff --git a/fastlane/Fastfile b/fastlane/Fastfile new file mode 100644 index 0000000..938a7a4 --- /dev/null +++ b/fastlane/Fastfile @@ -0,0 +1,24 @@ +# This file contains the fastlane.tools configuration +# You can find the documentation at https://docs.fastlane.tools +# +# For a list of all available actions, check out +# +# https://docs.fastlane.tools/actions +# +# For a list of all available plugins, check out +# +# https://docs.fastlane.tools/plugins/available-plugins +# + +# Uncomment the line if you want fastlane to automatically update itself +# update_fastlane + +default_platform(:ios) + +platform :ios do + desc "Push a new beta build to TestFlight" + lane :beta do + build_app(scheme: "Ifish") + upload_to_testflight + end +end diff --git a/fastlane/README.md b/fastlane/README.md new file mode 100644 index 0000000..99b6dd4 --- /dev/null +++ b/fastlane/README.md @@ -0,0 +1,29 @@ +fastlane documentation +================ +# Installation + +Make sure you have the latest version of the Xcode command line tools installed: + +``` +xcode-select --install +``` + +Install _fastlane_ using +``` +[sudo] gem install fastlane -NV +``` +or alternatively using `brew cask install fastlane` + +# Available Actions +## iOS +### ios beta +``` +fastlane ios beta +``` +Push a new beta build to TestFlight + +---- + +This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run. +More information about fastlane can be found on [fastlane.tools](https://fastlane.tools). +The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).