From 0de4cf306d8e13fd57b3e04bfb81362a10f12a4d Mon Sep 17 00:00:00 2001 From: Davin <591807572@qq.com> Date: 星期一, 10 七月 2023 16:10:53 +0800 Subject: [PATCH] feature UI补全 --- EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_hang_up@3x.png | 0 EZSDK/EZSDK/EZ/Global/EZHttpUtil.h | 8 EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_play@2x.png | 0 EZSDK/EZSDK/EZ/UIViewControllers/EZLivePlayViewController.m | 13 EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_pause@3x.png | 0 EZDemo/HDLEZDemo/HDLEZDemo/libEZSDK.a | 0 EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_hang_up@3x.png | 0 EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_hd_full@3x.png | 0 EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_smooth@2x.png | 0 EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_sound_off@3x.png | 0 EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.m | 20 - EZSDK.IOS/EZSDK.IOS/ApiDefinition.cs | 152 +++++++------- EZSDK.IOS/EZSDK.IOS/Resources/large_back_btn@2x.png | 0 EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZVideoDoorMsgCell.m | 2 EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_hang_up@2x.png | 0 EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZVideoDoorToolView.m | 22 + EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_balance@3x.png | 0 EZSDK/EZSDK/EZ/TempPassword/Controllers/HDLEZDeviceMsgListViewController.m | 103 +++++++--- EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_ignore@3x.png | 0 EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_exit@2x.png | 0 EZDemo/HDLEZDemo/HDLEZDemo/AppDelegate.m | 4 EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZVideoDoorToolView.h | 4 EZSDK.IOS/EZSDK.IOS/EZSDK.IOS.csproj | 35 ++ EZSDK/EZSDK/EZ/TempPassword/Models/HDLEZDeviceMsgInfoModel.m | 8 EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_balance@2x.png | 0 EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_sound_off@2x.png | 0 EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_hang_up@2x.png | 0 EZDemo/HDLEZDemo/HDLEZDemo/resources/en.lproj/Localizable.strings | 14 + EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_ignore@2x.png | 0 EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_pause@2x.png | 0 EZSDK/EZSDK/EZ/TempPassword/Models/HDLEZDeviceMsgInfoModel.h | 9 EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_exit@3x.png | 0 EZDemo/HDLEZDemo/HDLEZDemo/Assets.xcassets/hdl_ez_msg_placeholder.imageset/hdl_ez_msg_placeholder@3x.png | 0 EZDemo/HDLEZDemo/HDLEZDemo/ViewController.m | 4 EZSDK.IOS/EZSDK.IOS/Library/libEZSDK.a | 0 EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_smooth@3x.png | 0 EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_volume@3x.png | 0 EZSDK.IOS/EZSDK.IOS/Resources/large_back_btn@3x.png | 0 EZSDK/EZSDK/EZ/UIViewControllers/EZSettingViewController.m | 117 ++++++++++- EZDemo/HDLEZDemo/HDLEZDemo/EZMain.storyboard | 4 EZDemo/HDLEZDemo/HDLEZDemo/resources/zh-Hans.lproj/Localizable.strings | 14 + EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_volume@2x.png | 0 EZDemo/HDLEZDemo/HDLEZDemo/Info.plist | 2 EZSDK/EZSDK/EZ/Global/EZHttpUtil.m | 18 EZDemo/HDLEZDemo/HDLEZDemo/Assets.xcassets/hdl_ez_msg_placeholder.imageset/hdl_ez_msg_placeholder@2x.png | 0 EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_hd_full@2x.png | 0 EZDemo/HDLEZDemo/HDLEZDemo/Assets.xcassets/hdl_ez_msg_placeholder.imageset/Contents.json | 22 ++ EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_play@3x.png | 0 48 files changed, 402 insertions(+), 173 deletions(-) diff --git a/EZDemo/HDLEZDemo/HDLEZDemo/AppDelegate.m b/EZDemo/HDLEZDemo/HDLEZDemo/AppDelegate.m index 663c19b..c7cdef8 100644 --- a/EZDemo/HDLEZDemo/HDLEZDemo/AppDelegate.m +++ b/EZDemo/HDLEZDemo/HDLEZDemo/AppDelegate.m @@ -25,10 +25,10 @@ // Override point for customization after application launch. [[EZSDK sharedInstance] initLibWithAppKey:@"1aa98a90489b4838b966b57018b4b04b" globalAppKey:@"1aa98a90489b4838b966b57018b4b04b"]; // [[EZSDK sharedInstance] initLibWithAppKey:@"941b1b72b6294998acfd36c14931b675" globalAppKey:@"941b1b72b6294998acfd36c14931b675"]; - [[EZSDK sharedInstance] setHDlAccessToken:@"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiI5ZmI0M2UyOTdjMTk0NTliOTVlMDUzNzIwZjNiNjYyZiIsImNvbXBhbnlJZCI6IjAiLCJyb2xlIjoiIiwiaGVhZGVyUHJlZml4IjoiQmVhcmVyICIsInVzZXJBY2NvdW50Ijoid3hyIiwidGVuYW50SWQiOiIyMCIsInVzZXJUeXBlIjoiVVNFUl9DIiwidG9rZW5UeXBlIjoiYWNjZXNzX3Rva2VuIiwidXNlck5hbWUiOiJ3eHIiLCJ1c2VyRGF0YVJpZ2h0IjoiMSIsIm9wZW5BcHBsaWNhdGlvbklkIjoiMCIsInVzZXJJZCI6IjEzOTIwMzU1NjgyMDQ0MjMxNjkiLCJleHAiOjE2ODgwMTY4MTQsIm5iZiI6MTY4ODAwOTYxNH0.kJ-NPJIU314yz0pvD4ccmnA7_bwjbB94bpo-FBQZUPUrVz6BVSOvheiP_zzVnW16m2pArt-3O_Y8v4SfnnGWfW5X95AbAHsDwKT0Uva2PZMQaCm07HPbz02tZcRT4ssRCDMQEiDqTqzvp_fL3dhC6IrPLmUbYFy03VEPEJ4Zwtc" refreshToken:@"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiI3YTI1NjE5YTUzNDk0NWE3YTE2MGViODZlZGM3ZmFiNiIsImNvbXBhbnlJZCI6IjAiLCJoZWFkZXJQcmVmaXgiOiJCZWFyZXIgIiwidGVuYW50SWQiOiIyMCIsInRva2VuVHlwZSI6InJlZnJlc2hfdG9rZW4iLCJvcGVuQXBwbGljYXRpb25JZCI6IjAiLCJ1c2VySWQiOiIxMzkyMDM1NTY4MjA0NDIzMTY5IiwiZXhwIjoxNjg4NjE0NDE0LCJuYmYiOjE2ODgwMDk2MTR9.NnwX6Bpzv5s3EOTs-o13UB65bCFj_d8K81O9HQkjLbwtQamWs1QY902E1e4j2QM8E5tDFcz5Z5uGcVRyDb2_S09MU6uYArSU3xcKggt4lvdhvxIENrSmFQFBKbA40lNflYo7jZ5Mr2x-vgC0wdYw9s3JMe_jBnNm-KuQKr-rWUo"]; + [[EZSDK sharedInstance] setHDlAccessToken:@"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiIyOTRkNmI1ZGIyZTE0OTBiOGVjZGZjMGE1YmZkMzM0MCIsImNvbXBhbnlJZCI6IjAiLCJyb2xlIjoiIiwiaGVhZGVyUHJlZml4IjoiQmVhcmVyICIsInVzZXJBY2NvdW50Ijoid3hyIiwidGVuYW50SWQiOiIyMCIsInVzZXJUeXBlIjoiVVNFUl9DIiwidG9rZW5UeXBlIjoiYWNjZXNzX3Rva2VuIiwidXNlck5hbWUiOiJ3eHIiLCJ1c2VyRGF0YVJpZ2h0IjoiMSIsIm9wZW5BcHBsaWNhdGlvbklkIjoiMCIsInVzZXJJZCI6IjEzOTIwMzU1NjgyMDQ0MjMxNjkiLCJleHAiOjE2ODg3Mjg5MTQsIm5iZiI6MTY4ODcyMTcxNH0.M-Q-M1o0FFIxdU8jjoFP3kHJn9YCtDGa1QDfmEd71fpxP_MfXKLITfZ08OL4ORpgLGM6pKvWHduG-WrR6qJqDiUkL-xFV10pdXXN2OXN6uBRL06Ab5uo3ybOn1YDJTd_LY6HuZxblnckmXNcCCoDEfGqIpTTl00HcEw2E4uexoM" refreshToken:@"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiI1NGRhMzk1ZGE0ZGM0YzgwODYyNGMyY2JlYWZiMjFmNiIsImNvbXBhbnlJZCI6IjAiLCJoZWFkZXJQcmVmaXgiOiJCZWFyZXIgIiwidGVuYW50SWQiOiIyMCIsInRva2VuVHlwZSI6InJlZnJlc2hfdG9rZW4iLCJvcGVuQXBwbGljYXRpb25JZCI6IjAiLCJ1c2VySWQiOiIxMzkyMDM1NTY4MjA0NDIzMTY5IiwiZXhwIjoxNjg5MzI2NTE0LCJuYmYiOjE2ODg3MjE3MTR9.FPQUh_0HyO-TYzNhm1gnr8Gpbe2q3LMXkvJR10wZvk1NwYpsU7x4ekBMWYBL_PZ9BT_pEQ_0GzZRIkPQsZ-NgZtx2NmJ9CcE_qTwtyi9JLnpFsYDWn7sWSSpwDYJYmfT04Oqfu466Pgthibc59HZcZo629CjN7FkJCV5Wv3lL5k"]; [[EZSDK sharedInstance] setRequestHttpsHostAndPlatform:@"https://test-gz.hdlcontrol.com" platform:1 homeId:@"1547099040465408002"]; // [[EZSDK sharedInstance] setRequestHttpsHostAndPlatform:@"https://nearest.hdlcontrol.com" platform:1 homeId:@"1546324800135176193"]; - [[EZSDK sharedInstance] setEZAccessToken:@"ra.7k5en870837dvic92xsbtkoa4y01rfgr-3nr377z09k-1mihhva-yifqlowra"]; + [[EZSDK sharedInstance] setEZAccessToken:@"ra.5b950z7g0d00zrtl62938p9mcq6fr7yj-1e833bz5oi-1lfptjs-2hswa4ysz"]; // [[EZSDK sharedInstance] setEZAccessToken:@"ra.3hkirwcadrpfmaa89wep99io3wto4yds-7zptb10d20-1wxg4f3-ygiojudee"]; diff --git a/EZDemo/HDLEZDemo/HDLEZDemo/Assets.xcassets/hdl_ez_msg_placeholder.imageset/Contents.json b/EZDemo/HDLEZDemo/HDLEZDemo/Assets.xcassets/hdl_ez_msg_placeholder.imageset/Contents.json new file mode 100644 index 0000000..adc62cb --- /dev/null +++ b/EZDemo/HDLEZDemo/HDLEZDemo/Assets.xcassets/hdl_ez_msg_placeholder.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "hdl_ez_msg_placeholder@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "hdl_ez_msg_placeholder@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/EZDemo/HDLEZDemo/HDLEZDemo/Assets.xcassets/hdl_ez_msg_placeholder.imageset/hdl_ez_msg_placeholder@2x.png b/EZDemo/HDLEZDemo/HDLEZDemo/Assets.xcassets/hdl_ez_msg_placeholder.imageset/hdl_ez_msg_placeholder@2x.png new file mode 100644 index 0000000..bf22905 --- /dev/null +++ b/EZDemo/HDLEZDemo/HDLEZDemo/Assets.xcassets/hdl_ez_msg_placeholder.imageset/hdl_ez_msg_placeholder@2x.png Binary files differ diff --git a/EZDemo/HDLEZDemo/HDLEZDemo/Assets.xcassets/hdl_ez_msg_placeholder.imageset/hdl_ez_msg_placeholder@3x.png b/EZDemo/HDLEZDemo/HDLEZDemo/Assets.xcassets/hdl_ez_msg_placeholder.imageset/hdl_ez_msg_placeholder@3x.png new file mode 100644 index 0000000..6975eff --- /dev/null +++ b/EZDemo/HDLEZDemo/HDLEZDemo/Assets.xcassets/hdl_ez_msg_placeholder.imageset/hdl_ez_msg_placeholder@3x.png Binary files differ diff --git a/EZDemo/HDLEZDemo/HDLEZDemo/EZMain.storyboard b/EZDemo/HDLEZDemo/HDLEZDemo/EZMain.storyboard index d813fa0..9e5e029 100644 --- a/EZDemo/HDLEZDemo/HDLEZDemo/EZMain.storyboard +++ b/EZDemo/HDLEZDemo/HDLEZDemo/EZMain.storyboard @@ -2072,11 +2072,11 @@ <action selector="HDChanged:" destination="3ZH-14-C2h" eventType="valueChanged" id="fHK-6L-vL6"/> </connections> </switch> - <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" id="rv3-Sh-Gib"> + <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" id="rv3-Sh-Gib"> <rect key="frame" x="0.0" y="0.0" width="51" height="31"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <connections> - <action selector="privacyMasking:" destination="3ZH-14-C2h" eventType="valueChanged" id="Tj0-Ec-Wey"/> + <action selector="privacyMasking:" destination="3ZH-14-C2h" eventType="valueChanged" id="X9h-ed-zD5"/> </connections> </switch> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="hdl_ez_list_next" id="PR2-qZ-cVt"> diff --git a/EZDemo/HDLEZDemo/HDLEZDemo/Info.plist b/EZDemo/HDLEZDemo/HDLEZDemo/Info.plist index c890e35..2582b47 100644 --- a/EZDemo/HDLEZDemo/HDLEZDemo/Info.plist +++ b/EZDemo/HDLEZDemo/HDLEZDemo/Info.plist @@ -9,7 +9,7 @@ <key>NSPhotoLibraryUsageDescription</key> <string>姝� App 闇�瑕佹偍鐨勫悓鎰忔墠鑳借鍙栧獟浣撹祫鏂欏簱</string> <key>NSPhotoLibraryAddUsageDescription</key> - <string>姝� App 闇�瑕佹偍鐨勫悓鎰忔墠鑳借鍙栧獟浣撹祫鏂欏簱</string> + <string>姝� App 闇�瑕佹偍鐨勫悓鎰忔墠鑳借闂浉鍐屾潈闄�</string> <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> diff --git a/EZDemo/HDLEZDemo/HDLEZDemo/ViewController.m b/EZDemo/HDLEZDemo/HDLEZDemo/ViewController.m index 769bec0..9de4a47 100644 --- a/EZDemo/HDLEZDemo/HDLEZDemo/ViewController.m +++ b/EZDemo/HDLEZDemo/HDLEZDemo/ViewController.m @@ -10,9 +10,9 @@ //钀ょ煶闂ㄩ攣spk #define HDLEZ_DOOR_SPK @"security.door.ezviz" -#define HDLEZ_DEVICEID @"1673936447243640833" +#define HDLEZ_DEVICEID @"1678282604879122434" //#define HDLEZ_DEVICESERIAL @"K36229010" -#define HDLEZ_DEVICESERIAL @"J92513662" +#define HDLEZ_DEVICESERIAL @"L32590140" @interface ViewController ()<EZSDKDelegate> diff --git a/EZDemo/HDLEZDemo/HDLEZDemo/libEZSDK.a b/EZDemo/HDLEZDemo/HDLEZDemo/libEZSDK.a index 9fd2450..0249eba 100644 --- a/EZDemo/HDLEZDemo/HDLEZDemo/libEZSDK.a +++ b/EZDemo/HDLEZDemo/HDLEZDemo/libEZSDK.a Binary files differ diff --git a/EZDemo/HDLEZDemo/HDLEZDemo/resources/en.lproj/Localizable.strings b/EZDemo/HDLEZDemo/HDLEZDemo/resources/en.lproj/Localizable.strings index b5a4f81..7937614 100644 --- a/EZDemo/HDLEZDemo/HDLEZDemo/resources/en.lproj/Localizable.strings +++ b/EZDemo/HDLEZDemo/HDLEZDemo/resources/en.lproj/Localizable.strings @@ -118,6 +118,8 @@ "device_full_scene_sound_off" = "Sound off"; "device_full_scene_quality" = "Articulation"; "device_full_scene_exit_full" = "Exit"; +"device_callout_answer" = "Answered"; +"device_callout_no_answer" = "Missed"; "dmessage_title"="Message"; "message_read"="Mark as Read"; @@ -156,6 +158,10 @@ "setting_formatting_alert_message" = "You are currently formatting an SD card"; "setting_opration_fail"="Operation failed."; "setting_opration_success"="Completed."; +"setting_privacy_masking_ing"="Running, please try again later"; +"setting_privacy_masking_fail"="Setup failed, please try again later"; +"setting_sd_card_success"="Successful formatting"; +"setting_sd_card_fail"="Formatting failed, please try again"; "setting_switching"="Switching. Please wait..."; "setting_device_security_check"="Security Authentication"; "setting_input_code_plz"="Input the device verification code (6 characters on the device label)."; @@ -239,3 +245,11 @@ //閫氱敤 "hdl_ez_common_no_data"="No Data"; "hdl_ez_download"="Download"; +"hdl_ez_download_selectPhotos" = "Select a photo"; +"hdl_ez_download_takePhoto" = "Take a picture"; +"hdl_ez_download_selectFrAlbum" = "Select from the albums"; +"hdl_ez_download_cancle"= "Cancle"; +"hdl_ez_download_tip" = "Tips"; +"hdl_ez_download_auth" = "Please authorize access"; +"hdl_ez_download_sure" = "Sure"; +"hdl_ez_download_toSet" = "Setting"; diff --git a/EZDemo/HDLEZDemo/HDLEZDemo/resources/zh-Hans.lproj/Localizable.strings b/EZDemo/HDLEZDemo/HDLEZDemo/resources/zh-Hans.lproj/Localizable.strings index 1a1a5b7..01e9e45 100644 --- a/EZDemo/HDLEZDemo/HDLEZDemo/resources/zh-Hans.lproj/Localizable.strings +++ b/EZDemo/HDLEZDemo/HDLEZDemo/resources/zh-Hans.lproj/Localizable.strings @@ -78,6 +78,8 @@ "device_full_scene_sound_off" = "闈欓煶"; "device_full_scene_quality" = "娓呮櫚搴�"; "device_full_scene_exit_full" = "閫�鍑哄叏灞�"; +"device_callout_answer" = "宸叉帴"; +"device_callout_no_answer" = "鏈帴"; "device_open"="寮�闂�"; "device_open_success"="寮�闂ㄦ垚鍔燂紒"; @@ -157,6 +159,10 @@ "setting_formatting_alert_message" = "鎮ㄥ綋鍓嶆鍦ㄦ牸寮忓寲SD鍗�"; "setting_opration_fail"="鎿嶄綔澶辫触"; "setting_opration_success"="鎿嶄綔鎴愬姛"; +"setting_privacy_masking_ing"="姝e湪鎵ц涓紝璇风◢鍚庡啀璇�"; +"setting_privacy_masking_fail"="璁剧疆澶辫触锛岃绋嶅悗鍐嶈瘯"; +"setting_sd_card_success"="鏍煎紡鍖栨垚鍔�"; +"setting_sd_card_fail"="鏍煎紡鍖栧け璐ワ紝璇烽噸鏂板啀璇�"; "setting_switching"="姝e湪鍒囨崲锛岃绋嶅��..."; "setting_device_security_check"="璁惧鎿嶄綔瀹夊叏楠岃瘉"; "setting_input_code_plz"="璇疯緭鍏ヨ璁惧鐨勮澶囬獙璇佺爜锛堣澶囨爣绛句笂鐨�6浣嶅瓧姣嶏級"; @@ -240,3 +246,11 @@ //閫氱敤 "hdl_ez_common_no_data"="鏆傛棤鏁版嵁"; "hdl_ez_download"="涓嬭浇"; +"hdl_ez_download_selectPhotos" = "閫夊彇鐓х墖"; +"hdl_ez_download_takePhoto" = "鎷嶇収"; +"hdl_ez_download_selectFrAlbum" = "浠庣浉鍐岄�夊彇"; +"hdl_ez_download_cancle"= "鍙栨秷"; +"hdl_ez_download_tip" = "娓╅Θ鎻愮ず"; +"hdl_ez_download_auth" = "璇锋墦寮�璁块棶鏉冮檺"; +"hdl_ez_download_sure" = "纭畾"; +"hdl_ez_download_toSet" = "鍘昏缃�"; diff --git a/EZSDK.IOS/EZSDK.IOS/ApiDefinition.cs b/EZSDK.IOS/EZSDK.IOS/ApiDefinition.cs index 2013e15..b845f1b 100644 --- a/EZSDK.IOS/EZSDK.IOS/ApiDefinition.cs +++ b/EZSDK.IOS/EZSDK.IOS/ApiDefinition.cs @@ -3,97 +3,101 @@ namespace EZSDK.IOS { - // @protocol EZSDKDelegate <NSObject> - [Protocol, Model(AutoGeneratedName = true)] - [BaseType(typeof(NSObject))] - interface EZSDKDelegate - { - // @required -(void)addDeviceSuccessed:(NSString *)deviceSerial; - [Abstract] - [Export("addDeviceSuccessed:")] - void AddDeviceSuccessed(string deviceSerial); - } + // @protocol EZSDKDelegate <NSObject> + [Protocol, Model(AutoGeneratedName = true)] + [BaseType(typeof(NSObject))] + interface EZSDKDelegate + { + // @required -(void)addDeviceSuccessed:(NSString *)deviceSerial; + [Abstract] + [Export("addDeviceSuccessed:")] + void AddDeviceSuccessed(string deviceSerial); + } - // @interface EZSDK : NSObject - [BaseType(typeof(NSObject))] - interface EZSDK - { - [Wrap("WeakDelegate")] - EZSDKDelegate Delegate { get; set; } + // @interface EZSDK : NSObject + [BaseType(typeof(NSObject))] + interface EZSDK + { + [Wrap("WeakDelegate")] + EZSDKDelegate Delegate { get; set; } - // @property (nonatomic, weak) id<EZSDKDelegate> delegate; - [NullAllowed, Export("delegate", ArgumentSemantic.Weak)] - NSObject WeakDelegate { get; set; } + // @property (nonatomic, weak) id<EZSDKDelegate> delegate; + [NullAllowed, Export("delegate", ArgumentSemantic.Weak)] + NSObject WeakDelegate { get; set; } - // @property (nonatomic, strong) NSArray * connectTipModels; - [Export("connectTipModels", ArgumentSemantic.Strong)] - //[Verify(StronglyTypedNSArray)] - NSObject[] ConnectTipModels { get; set; } + // @property (nonatomic, strong) NSArray * connectTipModels; + [Export("connectTipModels", ArgumentSemantic.Strong)] + // [Verify(StronglyTypedNSArray)] + NSObject[] ConnectTipModels { get; set; } - // +(instancetype)sharedInstance; - [Static] - [Export("sharedInstance")] - EZSDK SharedInstance(); + // +(instancetype)sharedInstance; + [Static] + [Export("sharedInstance")] + EZSDK SharedInstance(); - // -(BOOL)initLibWithAppKey:(NSString *)appKey globalAppKey:(NSString *)globalAppKey; - [Export("initLibWithAppKey:globalAppKey:")] - bool InitLibWithAppKey(string appKey, string globalAppKey); + // -(BOOL)initLibWithAppKey:(NSString *)appKey globalAppKey:(NSString *)globalAppKey; + [Export("initLibWithAppKey:globalAppKey:")] + bool InitLibWithAppKey(string appKey, string globalAppKey); - // -(void)setEZAccessToken:(NSString *)accessToken; - [Export("setEZAccessToken:")] - void SetEZAccessToken(string accessToken); + // -(void)setEZAccessToken:(NSString *)accessToken; + [Export("setEZAccessToken:")] + void SetEZAccessToken(string accessToken); - // -(void)setHDlAccessToken:(NSString *)accessToken refreshToken:(NSString *)refreshToken; - [Export("setHDlAccessToken:refreshToken:")] - void SetHDlAccessToken(string accessToken, string refreshToken); + // -(void)setHDlAccessToken:(NSString *)accessToken refreshToken:(NSString *)refreshToken; + [Export("setHDlAccessToken:refreshToken:")] + void SetHDlAccessToken(string accessToken, string refreshToken); - // -(void)setRequestHttpsHostAndPlatform:(NSString *)requestHttpsHost platform:(int)platform homeId:(NSString *)homeId; - [Export("setRequestHttpsHostAndPlatform:platform:homeId:")] - void SetRequestHttpsHostAndPlatform(string requestHttpsHost, int platform, string homeId); + // -(void)setRequestHttpsHostAndPlatform:(NSString *)requestHttpsHost platform:(int)platform homeId:(NSString *)homeId; + [Export("setRequestHttpsHostAndPlatform:platform:homeId:")] + void SetRequestHttpsHostAndPlatform(string requestHttpsHost, int platform, string homeId); - // -(void)go2EZvizMonitor; - [Export("go2EZvizMonitor")] - void Go2EZvizMonitor(); + // -(void)go2EZvizMonitor; + [Export("go2EZvizMonitor")] + void Go2EZvizMonitor(); - // -(void)toEZDeviceListViewWithFilterTypes:(NSArray *)filterTepes; - [Export("toEZDeviceListViewWithFilterTypes:")] - //[Verify(StronglyTypedNSArray)] - void ToEZDeviceListViewWithFilterTypes(NSObject[] filterTepes); + // -(void)toEZDeviceListViewWithFilterTypes:(NSArray *)filterTepes; + [Export("toEZDeviceListViewWithFilterTypes:")] + // [Verify(StronglyTypedNSArray)] + void ToEZDeviceListViewWithFilterTypes(NSObject[] filterTepes); - // -(void)addEzvizMonitor; - [Export("addEzvizMonitor")] - void AddEzvizMonitor(); + // -(void)addEzvizMonitor; + [Export("addEzvizMonitor")] + void AddEzvizMonitor(); - // -(void)addEzvizMonitorWithDeviceType:(NSString *)deviceType; - [Export("addEzvizMonitorWithDeviceType:")] - void AddEzvizMonitorWithDeviceType(string deviceType); + // -(void)addEzvizMonitorWithDeviceType:(NSString *)deviceType; + [Export("addEzvizMonitorWithDeviceType:")] + void AddEzvizMonitorWithDeviceType(string deviceType); - // -(void)Play:(id)deviceInfo; - [Export("Play:")] - void Play(NSObject deviceInfo); + // -(void)Play:(id)deviceInfo; + [Export("Play:")] + void Play(NSObject deviceInfo); - // -(void)PlayWithDeviceSerial:(NSString *)deviceSerial; - [Export("PlayWithDeviceSerial:")] - void PlayWithDeviceSerial(string deviceSerial); + // -(void)Play:(id)deviceInfo showCallout:(BOOL)isShow; + [Export("Play:showCallout:")] + void Play(NSObject deviceInfo, bool isShow); - // -(void)PlayWithDeviceSerial:(NSString *)deviceSerial deviceId:(NSString *)deviceId deviceType:(NSString *)deviceType; - [Export("PlayWithDeviceSerial:deviceId:deviceType:")] - void PlayWithDeviceSerial(string deviceSerial, string deviceId, string deviceType); + // -(void)PlayWithDeviceSerial:(NSString *)deviceSerial; + [Export("PlayWithDeviceSerial:")] + void PlayWithDeviceSerial(string deviceSerial); - // -(void)setting:(id)deviceInfo; - [Export("setting:")] - void Setting(NSObject deviceInfo); + // -(void)PlayWithDeviceSerial:(NSString *)deviceSerial deviceId:(NSString *)deviceId deviceType:(NSString *)deviceType; + [Export("PlayWithDeviceSerial:deviceId:deviceType:")] + void PlayWithDeviceSerial(string deviceSerial, string deviceId, string deviceType); - // -(void)playBackVideo:(id)deviceInfo; - [Export("playBackVideo:")] - void PlayBackVideo(NSObject deviceInfo); + // -(void)setting:(id)deviceInfo; + [Export("setting:")] + void Setting(NSObject deviceInfo); - // -(void)toTemPassView:(NSString *)deviceId; - [Export("toTemPassView:")] - void ToTemPassView(string deviceId); + // -(void)playBackVideo:(id)deviceInfo; + [Export("playBackVideo:")] + void PlayBackVideo(NSObject deviceInfo); - // -(void)toDeviceMsgListView:(NSString *)deviceId; - [Export("toDeviceMsgListView:")] - void ToDeviceMsgListView(string deviceId); - } + // -(void)toTemPassView:(NSString *)deviceId; + [Export("toTemPassView:")] + void ToTemPassView(string deviceId); + + // -(void)toDeviceMsgListView:(NSString *)deviceId; + [Export("toDeviceMsgListView:")] + void ToDeviceMsgListView(string deviceId); + } } diff --git a/EZSDK.IOS/EZSDK.IOS/EZSDK.IOS.csproj b/EZSDK.IOS/EZSDK.IOS/EZSDK.IOS.csproj index 52055a1..1fbd594 100644 --- a/EZSDK.IOS/EZSDK.IOS/EZSDK.IOS.csproj +++ b/EZSDK.IOS/EZSDK.IOS/EZSDK.IOS.csproj @@ -46,18 +46,15 @@ <ObjcBindingCoreSource Include="Structs.cs" /> </ItemGroup> <ItemGroup> - <NativeReference Include="Library\libEZSDK.a"> - <Kind>Static</Kind> - <Frameworks>UIKit Foundation OpenAL CoreMedia GLKit AudioToolbox ExternalAccessory VideoToolbox MobileCoreServices SystemConfiguration NetworkExtension AVFoundation</Frameworks> - <LinkerFlags> -dead_strip -lc++ -lsqlite3.0 -lz -liconv.2.4.0 -lbz2 -ObjC</LinkerFlags> - <IsCxx>True</IsCxx> - <ForceLoad>True</ForceLoad> - </NativeReference> <NativeReference Include="Library\lib\FQDateTimeSDK.framework"> <Kind>Framework</Kind> </NativeReference> <NativeReference Include="Library\lib\EZOpenSDKFramework.framework"> <Kind>Framework</Kind> + </NativeReference> + <NativeReference Include="Library\libEZSDK.a"> + <Kind>Static</Kind> + <SmartLink>False</SmartLink> </NativeReference> </ItemGroup> <ItemGroup> @@ -83,6 +80,30 @@ <BundleResource Include="Resources\hdl_ez_wifi_connect_step2%403x.png" /> <BundleResource Include="Resources\hdl_ez_add_device_success%403x.png" /> <BundleResource Include="Resources\hdl_ez_add_device_success%402x.png" /> + <BundleResource Include="Resources\hdl_ez_cat_eyes_full_balance%402x.png" /> + <BundleResource Include="Resources\hdl_ez_cat_eyes_full_balance%403x.png" /> + <BundleResource Include="Resources\hdl_ez_cat_eyes_full_exit%402x.png" /> + <BundleResource Include="Resources\hdl_ez_cat_eyes_full_exit%403x.png" /> + <BundleResource Include="Resources\hdl_ez_cat_eyes_full_hang_up%402x.png" /> + <BundleResource Include="Resources\hdl_ez_cat_eyes_full_hang_up%403x.png" /> + <BundleResource Include="Resources\hdl_ez_cat_eyes_full_hd_full%402x.png" /> + <BundleResource Include="Resources\hdl_ez_cat_eyes_full_hd_full%403x.png" /> + <BundleResource Include="Resources\hdl_ez_cat_eyes_full_pause%402x.png" /> + <BundleResource Include="Resources\hdl_ez_cat_eyes_full_pause%403x.png" /> + <BundleResource Include="Resources\hdl_ez_cat_eyes_full_play%402x.png" /> + <BundleResource Include="Resources\hdl_ez_cat_eyes_full_play%403x.png" /> + <BundleResource Include="Resources\hdl_ez_cat_eyes_full_smooth%402x.png" /> + <BundleResource Include="Resources\hdl_ez_cat_eyes_full_smooth%403x.png" /> + <BundleResource Include="Resources\hdl_ez_cat_eyes_full_sound_off%402x.png" /> + <BundleResource Include="Resources\hdl_ez_cat_eyes_full_sound_off%403x.png" /> + <BundleResource Include="Resources\hdl_ez_cat_eyes_full_volume%402x.png" /> + <BundleResource Include="Resources\hdl_ez_cat_eyes_full_volume%403x.png" /> + <BundleResource Include="Resources\hdl_ez_cat_eyes_hang_up%402x.png" /> + <BundleResource Include="Resources\hdl_ez_cat_eyes_hang_up%403x.png" /> + <BundleResource Include="Resources\hdl_ez_cat_eyes_ignore%402x.png" /> + <BundleResource Include="Resources\hdl_ez_cat_eyes_ignore%403x.png" /> + <BundleResource Include="Resources\large_back_btn%402x.png" /> + <BundleResource Include="Resources\large_back_btn%403x.png" /> </ItemGroup> <Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.ObjCBinding.CSharp.targets" /> </Project> \ No newline at end of file diff --git a/EZSDK.IOS/EZSDK.IOS/Library/libEZSDK.a b/EZSDK.IOS/EZSDK.IOS/Library/libEZSDK.a index 0467cbc..7be1c51 100644 --- a/EZSDK.IOS/EZSDK.IOS/Library/libEZSDK.a +++ b/EZSDK.IOS/EZSDK.IOS/Library/libEZSDK.a Binary files differ diff --git a/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_balance@2x.png b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_balance@2x.png new file mode 100644 index 0000000..5f574f3 --- /dev/null +++ b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_balance@2x.png Binary files differ diff --git a/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_balance@3x.png b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_balance@3x.png new file mode 100644 index 0000000..ab72115 --- /dev/null +++ b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_balance@3x.png Binary files differ diff --git a/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_exit@2x.png b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_exit@2x.png new file mode 100644 index 0000000..5d8c01b --- /dev/null +++ b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_exit@2x.png Binary files differ diff --git a/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_exit@3x.png b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_exit@3x.png new file mode 100644 index 0000000..a521e39 --- /dev/null +++ b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_exit@3x.png Binary files differ diff --git a/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_hang_up@2x.png b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_hang_up@2x.png new file mode 100644 index 0000000..0756954 --- /dev/null +++ b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_hang_up@2x.png Binary files differ diff --git a/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_hang_up@3x.png b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_hang_up@3x.png new file mode 100644 index 0000000..b43e3e0 --- /dev/null +++ b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_hang_up@3x.png Binary files differ diff --git a/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_hd_full@2x.png b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_hd_full@2x.png new file mode 100644 index 0000000..d5d902e --- /dev/null +++ b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_hd_full@2x.png Binary files differ diff --git a/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_hd_full@3x.png b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_hd_full@3x.png new file mode 100644 index 0000000..94b7cfa --- /dev/null +++ b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_hd_full@3x.png Binary files differ diff --git a/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_pause@2x.png b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_pause@2x.png new file mode 100644 index 0000000..25b9d43 --- /dev/null +++ b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_pause@2x.png Binary files differ diff --git a/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_pause@3x.png b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_pause@3x.png new file mode 100644 index 0000000..69070c0 --- /dev/null +++ b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_pause@3x.png Binary files differ diff --git a/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_play@2x.png b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_play@2x.png new file mode 100644 index 0000000..b01fbd1 --- /dev/null +++ b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_play@2x.png Binary files differ diff --git a/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_play@3x.png b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_play@3x.png new file mode 100644 index 0000000..1b153e5 --- /dev/null +++ b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_play@3x.png Binary files differ diff --git a/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_smooth@2x.png b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_smooth@2x.png new file mode 100644 index 0000000..9d63183 --- /dev/null +++ b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_smooth@2x.png Binary files differ diff --git a/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_smooth@3x.png b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_smooth@3x.png new file mode 100644 index 0000000..efaf68b --- /dev/null +++ b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_smooth@3x.png Binary files differ diff --git a/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_sound_off@2x.png b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_sound_off@2x.png new file mode 100644 index 0000000..dfb539c --- /dev/null +++ b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_sound_off@2x.png Binary files differ diff --git a/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_sound_off@3x.png b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_sound_off@3x.png new file mode 100644 index 0000000..331f2e9 --- /dev/null +++ b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_sound_off@3x.png Binary files differ diff --git a/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_volume@2x.png b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_volume@2x.png new file mode 100644 index 0000000..857ad1c --- /dev/null +++ b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_volume@2x.png Binary files differ diff --git a/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_volume@3x.png b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_volume@3x.png new file mode 100644 index 0000000..885bde1 --- /dev/null +++ b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_full_volume@3x.png Binary files differ diff --git a/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_hang_up@2x.png b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_hang_up@2x.png new file mode 100644 index 0000000..8bf91d6 --- /dev/null +++ b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_hang_up@2x.png Binary files differ diff --git a/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_hang_up@3x.png b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_hang_up@3x.png new file mode 100644 index 0000000..5faf8ca --- /dev/null +++ b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_hang_up@3x.png Binary files differ diff --git a/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_ignore@2x.png b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_ignore@2x.png new file mode 100644 index 0000000..2324070 --- /dev/null +++ b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_ignore@2x.png Binary files differ diff --git a/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_ignore@3x.png b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_ignore@3x.png new file mode 100644 index 0000000..9e96beb --- /dev/null +++ b/EZSDK.IOS/EZSDK.IOS/Resources/hdl_ez_cat_eyes_ignore@3x.png Binary files differ diff --git a/EZSDK.IOS/EZSDK.IOS/Resources/large_back_btn@2x.png b/EZSDK.IOS/EZSDK.IOS/Resources/large_back_btn@2x.png new file mode 100644 index 0000000..7804900 --- /dev/null +++ b/EZSDK.IOS/EZSDK.IOS/Resources/large_back_btn@2x.png Binary files differ diff --git a/EZSDK.IOS/EZSDK.IOS/Resources/large_back_btn@3x.png b/EZSDK.IOS/EZSDK.IOS/Resources/large_back_btn@3x.png new file mode 100644 index 0000000..d5c0441 --- /dev/null +++ b/EZSDK.IOS/EZSDK.IOS/Resources/large_back_btn@3x.png Binary files differ diff --git a/EZSDK/EZSDK/EZ/Global/EZHttpUtil.h b/EZSDK/EZSDK/EZ/Global/EZHttpUtil.h index 8802af2..be59522 100644 --- a/EZSDK/EZSDK/EZ/Global/EZHttpUtil.h +++ b/EZSDK/EZSDK/EZ/Global/EZHttpUtil.h @@ -145,19 +145,19 @@ /** * @since 娌充笢鑾峰彇璁惧娑堟伅 - * @param deviceId 璁惧id + * @param deviceSerial 璁惧搴忓垪鍙� * @param completion 鍥炶皟block锛宔rror涓虹┖鏃惰〃绀烘垚鍔� */ -- (void)getCoverSwitchStatus:(NSString *)deviceId +- (void)getCoverSwitchStatus:(NSString *)deviceSerial completion:(void (^)(ResponseData *responseData))completion; /** * @since 娌充笢鑾峰彇璁惧娑堟伅 - * @param deviceId 璁惧id + * @param deviceSerial 璁惧搴忓垪鍙� * @param enable 闅愮閬斀鐘舵�� * @param completion 鍥炶皟block锛宔rror涓虹┖鏃惰〃绀烘垚鍔� */ -- (void)getCoverSwitchStatus:(NSString *)deviceId +- (void)coverSwitchStatus:(NSString *)deviceSerial enable:(NSInteger)enable completion:(void (^)(ResponseData *responseData))completion; diff --git a/EZSDK/EZSDK/EZ/Global/EZHttpUtil.m b/EZSDK/EZSDK/EZ/Global/EZHttpUtil.m index a24250c..79ce90b 100644 --- a/EZSDK/EZSDK/EZ/Global/EZHttpUtil.m +++ b/EZSDK/EZSDK/EZ/Global/EZHttpUtil.m @@ -425,18 +425,18 @@ } /** - * @since 娌充笢鑾峰彇璁惧娑堟伅 - * @param deviceId 璁惧id + * @since 鑾峰彇闀滃ご闅愮閬斀鐘舵�� + * @param deviceSerial 璁惧搴忓垪鍙� * @param completion 鍥炶皟block锛宔rror涓虹┖鏃惰〃绀烘垚鍔� */ -- (void)getCoverSwitchStatus:(NSString *)deviceId +- (void)getCoverSwitchStatus:(NSString *)deviceSerial completion:(void (^)(ResponseData *responseData))completion { //璁剧疆璇锋眰鍙傛暟 NSMutableDictionary *parameters = [NSMutableDictionary dictionary]; - [parameters setValue:deviceId forKey:@"deviceId"]; + [parameters setValue:deviceSerial forKey:@"deviceSerial"]; [parameters setValue:@(1) forKey:@"platform"]; [parameters setValue:[NSString stringWithFormat:@"%@",[GlobalKit shareKit].hdlAppKey] forKey:@"appKey"]; - [parameters setValue:[GlobalKit shareKit].hdlHomeId forKey:@"homeId"]; + [parameters setValue:@([[GlobalKit shareKit].hdlHomeId integerValue]) forKey:@"homeId"]; parameters = [self GetSignRequestDictionary:parameters]; @@ -450,17 +450,17 @@ } /** - * @since 娌充笢鑾峰彇璁惧娑堟伅 - * @param deviceId 璁惧id + * @since 璁剧疆闀滃ご闅愮閬斀鐘舵�� + * @param deviceSerial 璁惧搴忓垪鍙� * @param enable 闅愮閬斀鐘舵�� * @param completion 鍥炶皟block锛宔rror涓虹┖鏃惰〃绀烘垚鍔� */ -- (void)getCoverSwitchStatus:(NSString *)deviceId +- (void)coverSwitchStatus:(NSString *)deviceSerial enable:(NSInteger)enable completion:(void (^)(ResponseData *responseData))completion { //璁剧疆璇锋眰鍙傛暟 NSMutableDictionary *parameters = [NSMutableDictionary dictionary]; - [parameters setValue:deviceId forKey:@"deviceId"]; + [parameters setValue:deviceSerial forKey:@"deviceSerial"]; [parameters setValue:@(enable) forKey:@"enable"]; [parameters setValue:@(1) forKey:@"platform"]; [parameters setValue:[NSString stringWithFormat:@"%@",[GlobalKit shareKit].hdlAppKey] forKey:@"appKey"]; diff --git a/EZSDK/EZSDK/EZ/TempPassword/Controllers/HDLEZDeviceMsgListViewController.m b/EZSDK/EZSDK/EZ/TempPassword/Controllers/HDLEZDeviceMsgListViewController.m index baac279..38efd50 100644 --- a/EZSDK/EZSDK/EZ/TempPassword/Controllers/HDLEZDeviceMsgListViewController.m +++ b/EZSDK/EZSDK/EZ/TempPassword/Controllers/HDLEZDeviceMsgListViewController.m @@ -110,39 +110,15 @@ weakSelf.msgListModel=[HDLEZDevMsgListModel yy_modelWithDictionary:responseData.data]; if (responseData.success) { weakSelf.msgListModel=[HDLEZDevMsgListModel yy_modelWithDictionary:responseData.data]; - if (weakSelf.msgListModel.list.count!=0) { - [weakSelf.msgList addObjectsFromArray:weakSelf.msgListModel.list]; - weakSelf.msgListV.msgList=weakSelf.msgList; + if (weakSelf.currentPageNo == 1) { + [weakSelf.msgList removeAllObjects]; + } + [weakSelf.msgList addObjectsFromArray:weakSelf.msgListModel.list]; + weakSelf.msgListV.msgList=weakSelf.msgList; + if (weakSelf.msgListModel.list.count == weakSelf.pageSize) { weakSelf.currentPageNo+=1; - }else{ -#warning mock - if (weakSelf.msgList.count == 0) { - HDLEZDeviceMsgInfoModel *model = [[HDLEZDeviceMsgInfoModel alloc] init]; - model.title = @"mock title 浣犲ソ浣犲ソ鎴戞槸瓒呴暱鐨勬祴璇曟爣棰橈紝浣犳潵鐪嬩笅鏄惁瓒呭嚭闀垮害锛屼綘濂戒綘濂芥垜鏄秴闀跨殑娴嬭瘯鏍囬锛屼綘鏉ョ湅涓嬫槸鍚﹁秴鍑洪暱搴�"; - model.createTime = @"2023.06.15"; - model.content = @"mock content"; - model.imageUrl = @"https://upload-images.jianshu.io/upload_images/5809200-a99419bb94924e6d.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"; - [weakSelf.msgList addObject:model]; - - HDLEZDeviceMsgInfoModel *model1 = [[HDLEZDeviceMsgInfoModel alloc] init]; - model1.title = @"mock title1锛屼綘濂戒綘濂�"; - model1.createTime = @"2023.06.15"; - model1.content = @"mock content1"; - model1.imageUrl = @"http://b.hiphotos.baidu.com/image/pic/item/e824b899a9014c08878b2c4c0e7b02087af4f4a3.jpg"; - [weakSelf.msgList addObject:model1]; - - HDLEZDeviceMsgInfoModel *model2 = [[HDLEZDeviceMsgInfoModel alloc] init]; - model2.title = @"mock title2"; - model2.createTime = @"2023.06.15"; - model2.content = @"mock content2"; - model2.imageUrl = @"https://fastly.picsum.photos/id/452/1000/3000.jpg?hmac=g6GQYs1wmiPeoKOdwI3ot1y4MInIj_dnPk_jCYbVYfk"; - [weakSelf.msgList addObject:model2]; - } - weakSelf.msgListV.msgList=weakSelf.msgList; - [weakSelf.footer endRefreshingWithNoMoreData]; - } - + [weakSelf.footer endRefreshingWithNoMoreData]; }else{ [weakSelf.view makeToast:responseData.message duration:1.5 @@ -168,6 +144,18 @@ } - (void)didClickDownLoad:(MWPhotoBrowser *)photoBrowser { + + __weak __typeof(self)weakSelf = self; + [self authPhotoLibraries:^(BOOL isAblity) { + if (isAblity) { + [weakSelf downloadTheImage]; + } else { + [weakSelf guideUserOpenAuth]; + } + }]; +} + +- (void)downloadTheImage { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ if (!self.currentPreviewPhoto || self.currentPreviewPhoto.length == 0) { [UIView dd_showMessage:NSLocalizedString(@"device_save_gallery_failure", @"涓嬭浇澶辫触")]; @@ -201,9 +189,59 @@ } else { - message = [error description]; + message = NSLocalizedString(@"device_save_gallery_failure", @"涓嬭浇澶辫触"); + NSLog(@"#######鍥剧墖淇濆瓨澶辫触锛�%@", [error description]); } [UIView dd_showMessage:message]; +} + +/*璁块棶鐩稿唽鏉冮檺 + */ +-(void)authPhotoLibraries:(void(^)(BOOL isAblity))result { + PHAuthorizationStatus author =[PHPhotoLibrary authorizationStatus]; + if (author == PHAuthorizationStatusRestricted || author ==PHAuthorizationStatusDenied){ + if (result) { + result(NO); + } + } else if (author == PHAuthorizationStatusNotDetermined) { // 棣栨鎺堟潈 + dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); + dispatch_async(queue, ^{ + [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) { + if (status != PHAuthorizationStatusAuthorized) { + if (result) { + result(NO); + } + } else { + if (result) { + result(YES); + } + } + }]; + }); + } else { + if (result) { + result(YES); + } + } +} + +/*寮曞鐢ㄦ埛鎺堟潈鑾峰彇鍥剧墖 + */ +- (void)guideUserOpenAuth{ + UIAlertController *alertC = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"hdl_ez_download_tip", @"娓╅Θ鎻愮ず") message:NSLocalizedString(@"hdl_ez_download_auth", @"璇锋墦寮�璁块棶鏉冮檺") preferredStyle:(UIAlertControllerStyleAlert)]; + UIAlertAction *alertA = [UIAlertAction actionWithTitle:NSLocalizedString(@"hdl_ez_download_cancle", @"鍙栨秷") style:(UIAlertActionStyleDefault) handler:nil]; + UIAlertAction *act = [UIAlertAction actionWithTitle:NSLocalizedString(@"hdl_ez_download_toSet", @"鍘昏缃�") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + // 寮曞鐢ㄦ埛璁剧疆 + NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString]; + + if ([[UIApplication sharedApplication] canOpenURL:url]) { + + [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil]; + } + }]; + [alertC addAction:alertA]; + [alertC addAction:act]; + [self presentViewController:alertC animated:YES completion:nil]; } #pragma mark PrivateMethod @@ -212,6 +250,7 @@ self.photos = [NSMutableArray array]; [self.photos addObject:[MWPhoto photoWithURL:[NSURL URLWithString:picUrl]]]; MWPhotoBrowser *browser = [[MWPhotoBrowser alloc] initWithDelegate:self]; + browser.zoomPhotosToFill = NO; [browser showDownloadBtn]; [self.navigationController pushViewController:browser animated:NO]; diff --git a/EZSDK/EZSDK/EZ/TempPassword/Models/HDLEZDeviceMsgInfoModel.h b/EZSDK/EZSDK/EZ/TempPassword/Models/HDLEZDeviceMsgInfoModel.h index 8c7e455..fc3143a 100644 --- a/EZSDK/EZSDK/EZ/TempPassword/Models/HDLEZDeviceMsgInfoModel.h +++ b/EZSDK/EZSDK/EZ/TempPassword/Models/HDLEZDeviceMsgInfoModel.h @@ -7,6 +7,13 @@ #import <Foundation/Foundation.h> +@interface HDLEZDeviceMsgExtInfoModel : NSObject + +@property (nonatomic, copy)NSString *picUrl; //鎴睆鍥剧墖閾炬帴 +@property (nonatomic, copy)NSString *answerStatus; // 鎺ュ惉鐘舵�� answer 宸叉帴鍚� no_answer 鏈帴鍚� + +@end + NS_ASSUME_NONNULL_BEGIN @interface HDLEZDeviceMsgInfoModel : NSObject @@ -14,7 +21,7 @@ @property (nonatomic, copy)NSString *content;//鍐呭 @property (nonatomic, copy)NSString *level;//娑堟伅绛夌骇 @property (nonatomic, copy)NSString *createTime;//鍒涘缓鏃堕棿 -@property (nonatomic, copy)NSString *imageUrl;//鎴睆鍥剧墖閾炬帴 +@property (nonatomic, strong) HDLEZDeviceMsgExtInfoModel *extInfo; // 2.0鐗堟湰鎵╁睍淇℃伅 @end NS_ASSUME_NONNULL_END diff --git a/EZSDK/EZSDK/EZ/TempPassword/Models/HDLEZDeviceMsgInfoModel.m b/EZSDK/EZSDK/EZ/TempPassword/Models/HDLEZDeviceMsgInfoModel.m index 1c4d7b5..dedab50 100644 --- a/EZSDK/EZSDK/EZ/TempPassword/Models/HDLEZDeviceMsgInfoModel.m +++ b/EZSDK/EZSDK/EZ/TempPassword/Models/HDLEZDeviceMsgInfoModel.m @@ -9,4 +9,12 @@ @implementation HDLEZDeviceMsgInfoModel ++ (NSDictionary *)modelContainerPropertyGenericClass { + return @{@"extInfo" : [HDLEZDeviceMsgExtInfoModel class]}; +} + +@end + +@implementation HDLEZDeviceMsgExtInfoModel + @end diff --git a/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.m b/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.m index 0596bbe..3da0a43 100644 --- a/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.m +++ b/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.m @@ -74,8 +74,8 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if (self.msgList.count <= indexPath.row) return; HDLEZDeviceMsgInfoModel *messageModel = self.msgList[indexPath.row]; - if (self.previewPic && messageModel.imageUrl && messageModel.imageUrl.length > 0) { - self.previewPic(messageModel.imageUrl); + if (self.previewPic && messageModel.extInfo.picUrl && messageModel.extInfo.picUrl.length > 0) { + self.previewPic(messageModel.extInfo.picUrl); } } @@ -90,19 +90,17 @@ HDLEZDeviceMsgInfoModel *messageModel = self.msgList[indexPath.row]; -#warning mock - NSString *stataus = @""; - if (indexPath.row == 0) { - stataus = @"鏈帴"; - messageModel.createTime = @""; - } else if (indexPath.row == 1) { - stataus = @"宸叉帴"; + NSString *status = @""; + if ([messageModel.extInfo.answerStatus isEqualToString:@"answer"]) { + status = HDLEZLocallizedString(@"device_callout_answer"); + } else if (([messageModel.extInfo.answerStatus isEqualToString:@"no_answer"])) { + status = HDLEZLocallizedString(@"device_callout_no_answer"); } - if (messageModel.createTime && messageModel.createTime.length == 13) { + if (messageModel.createTime && messageModel.createTime.length == 13) { // 姣杞 messageModel.createTime = [messageModel.createTime substringToIndex:10]; } NSString *messageTime = [self turnDate:messageModel.createTime]; - [cell configMessageInfoWithTitle:messageModel.content deviceStatus:stataus messageTime:messageTime messageImage:indexPath.row != 0 ? messageModel.imageUrl : @""]; + [cell configMessageInfoWithTitle:messageModel.content deviceStatus:status messageTime:messageTime messageImage:messageModel.extInfo.picUrl]; [cell showSpearator:(self.msgList.count != indexPath.row + 1)]; } diff --git a/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZVideoDoorMsgCell.m b/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZVideoDoorMsgCell.m index 35f4305..43a5a90 100644 --- a/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZVideoDoorMsgCell.m +++ b/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZVideoDoorMsgCell.m @@ -91,7 +91,7 @@ self.timeLabel.text = time; } if (messageUrl && messageUrl.length > 0) { - [self.messageImageView sd_setImageWithURL:[NSURL URLWithString:messageUrl] placeholderImageScale:[UIImage imageNamed:@""]]; + [self.messageImageView sd_setImageWithURL:[NSURL URLWithString:messageUrl] placeholderImageScale:[UIImage imageNamed:@"hdl_ez_msg_placeholder"]]; [self.messageImageView mas_updateConstraints:^(MASConstraintMaker *make) { make.width.mas_equalTo(72.); }]; diff --git a/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZVideoDoorToolView.h b/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZVideoDoorToolView.h index f747110..344135c 100644 --- a/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZVideoDoorToolView.h +++ b/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZVideoDoorToolView.h @@ -46,6 +46,10 @@ /// - Parameter isRing: 鏄惁姝e湪鍝嶉搩馃敂 - (void)ringRingRing:(BOOL)isRing; +/// 闅愯棌/灞曠ず瑙嗛娓呮櫚搴﹀脊妗嗭紙鍏ㄥ睆鐘舵�佷笅锛� +/// - Parameter isSelected: 闅愯棌 +- (void)qualityStatusChanged:(BOOL)isSelected; + @end NS_ASSUME_NONNULL_END diff --git a/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZVideoDoorToolView.m b/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZVideoDoorToolView.m index f04ef07..627f38d 100644 --- a/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZVideoDoorToolView.m +++ b/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZVideoDoorToolView.m @@ -178,6 +178,7 @@ - (void)playAction { [self playStatus:!self.isPlaying]; + [self qualityStatusChanged:YES]; if (self.fullOperation) { self.fullOperation(self.isPlaying ? HDLEZVideoFullSceneOperationOfPause : HDLEZVideoFullSceneOperationOfPlay); } @@ -185,22 +186,29 @@ - (void)volumeAction { [self soundOn:!self.soundOn]; + [self qualityStatusChanged:YES]; if (self.fullOperation) { self.fullOperation(self.soundOn ? HDLEZVideoFullSceneOperationOfSound : HDLEZVideoFullSceneOperationOfSoundOff); } } - (void)qualityAction { -// if (self.qualityControlBlock) { -// self.qualityControlBlock(self.videoLevel); -// } - self.qualityButton.selected = !self.qualityButton.selected; - self.qualityBox.hidden = !self.qualityButton.selected; - self.hangUpButton.enabled = !self.qualityButton.selected; - self.hangUpButton.alpha = self.qualityButton.selected ? 0.5 : 1; +// self.qualityButton.selected = !self.qualityButton.selected; +// self.qualityBox.hidden = !self.qualityButton.selected; +// self.hangUpButton.enabled = !self.qualityButton.selected; +// self.hangUpButton.alpha = self.qualityButton.selected ? 0.5 : 1; + [self qualityStatusChanged:self.qualityButton.selected]; +} + +- (void)qualityStatusChanged:(BOOL)isSelected { + self.qualityButton.selected = !isSelected; + self.qualityBox.hidden = isSelected; + self.hangUpButton.enabled = isSelected; + self.hangUpButton.alpha = !isSelected ? 0.5 : 1; } - (void)fullSceneAction { + [self qualityStatusChanged:YES]; if (self.fullOperation) { self.fullOperation(HDLEZVideoFullSceneOperationOfExitFull); } diff --git a/EZSDK/EZSDK/EZ/UIViewControllers/EZLivePlayViewController.m b/EZSDK/EZSDK/EZ/UIViewControllers/EZLivePlayViewController.m index 9db3569..fc46471 100644 --- a/EZSDK/EZSDK/EZ/UIViewControllers/EZLivePlayViewController.m +++ b/EZSDK/EZSDK/EZ/UIViewControllers/EZLivePlayViewController.m @@ -149,6 +149,7 @@ //鍒濆鍖栫浉鍏虫暟鎹� [self initialData]; + [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:HDLEZHEXCOLOR(0x1B2D4D, 1.),NSFontAttributeName:[UIFont systemFontOfSize:18]}]; // self.talkButton.enabled = self.deviceInfo.isSupportTalk; // self.controlButton.enabled = self.deviceInfo.isSupportPTZ; @@ -1728,13 +1729,11 @@ } break; case HDLEZVideoFullSceneOperationOfSound: { // 寮�鍚煶閲� - [_player openSound]; - NSLog(@"#######寮�鍚煶閲�"); + [self voiceButtonClicked:self.voiceButton]; } break; case HDLEZVideoFullSceneOperationOfSoundOff: { // 闈欓煶 - [_player closeSound]; - NSLog(@"#######闈欓煶"); + [self voiceButtonClicked:self.voiceButton]; } break; case HDLEZVideoFullSceneOperationOfSmooth: { // 娴佺晠 @@ -1758,6 +1757,12 @@ } } +- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event { + if (!self.fullSceneToolView.hidden) { + [self.fullSceneToolView qualityStatusChanged:YES]; + } +} + #pragma Setter - (void)setIsShowAlert:(BOOL)isShowAlert { _isShowAlert = isShowAlert; diff --git a/EZSDK/EZSDK/EZ/UIViewControllers/EZSettingViewController.m b/EZSDK/EZSDK/EZ/UIViewControllers/EZSettingViewController.m index 9ae55a2..95f6ae0 100644 --- a/EZSDK/EZSDK/EZ/UIViewControllers/EZSettingViewController.m +++ b/EZSDK/EZSDK/EZ/UIViewControllers/EZSettingViewController.m @@ -34,8 +34,11 @@ @property (nonatomic, weak) IBOutlet UILabel *nVersionLabel; @property (nonatomic, weak) IBOutlet UIImageView *updateImageView; @property (nonatomic, strong) UIButton *deleteButton; +@property (nonatomic, strong) UIButton *privacyMaskButton; // 闅愮閬斀鎵ц杩囩▼鎻愰啋鎸夐挳 @property (nonatomic, strong) EZDeviceVersion *deviceVersion; @property (nonatomic, strong) NSTimer *timer; +@property (nonatomic, assign) BOOL isCatEye; // 鏄惁涓虹尗鐪� +@property (nonatomic, assign) BOOL privacyMasking; // 闅愮閬斀璁剧疆涓� @end @@ -50,6 +53,14 @@ [super viewDidLoad]; self.title = NSLocalizedString(@"setting_device_set_title", @"璁惧璁剧疆"); + // 鐚溂 CS-DH1, CS-DP1, CS-CV336, CS-CTQ1P + // 闂ㄩ攣 DL30V,Y3000FV,DL20VC,DL31FS,DL30F,DL30,Y3000FVS,Y3000F + self.isCatEye = NO; + self.privacyMasking = NO; + self.privacyMaskSwitch.on = NO; + if ([self.deviceInfo.deviceType containsString:@"CS-DH1"] || [self.deviceInfo.deviceType containsString:@"CS-DP1"] || [self.deviceInfo.deviceType containsString:@"CS-CV336"] || [self.deviceInfo.deviceType containsString:@"CS-CTQ1P"]) { + self.isCatEye = YES; + } // Uncomment the following line to preserve selection between presentations. // self.clearsSelectionOnViewWillAppear = NO; @@ -81,8 +92,10 @@ self.videoSwitch.on = self.deviceInfo.isEncrypt; } [_settingList addObject:@[NSLocalizedString(@"setting_hardware_decoding", @"纭В鐮�")]]; - [_settingList addObject:@[NSLocalizedString(@"setting_privacy_masking", @"闅愮閬斀")]]; - [_settingList addObject:@[NSLocalizedString(@"setting_sd_card_formatting", @"SD鍗℃牸寮忓寲")]]; + if (!self.isCatEye) { + [_settingList addObject:@[NSLocalizedString(@"setting_privacy_masking", @"闅愮閬斀")]]; + [_settingList addObject:@[NSLocalizedString(@"setting_sd_card_formatting", @"SD鍗℃牸寮忓寲")]]; + } [_settingList addObject:@[NSLocalizedString(@"delete", @"鍒犻櫎")]]; self.serialLabel.text = self.deviceInfo.deviceSerial; @@ -104,6 +117,12 @@ [self.privacyMaskSwitch setOn:NO]; [self getPrivacyMaskSwitchStatus]; self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; + + [self.privacyMaskSwitch addSubview:self.privacyMaskButton]; + [self.privacyMaskButton addTarget:self action:@selector(privacyMaskingAction:) forControlEvents:UIControlEventTouchUpInside]; + [self.privacyMaskButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(UIEdgeInsetsZero); + }]; // [[EzvizDeviceManager sharedManager] startP2PHolePunching:_cameraInfo.cameraId completion:^(BOOL result, NSError *error) { // NSLog(@"result = %d, error = %@", result, error); // }]; @@ -170,7 +189,15 @@ __weak __typeof(self)weakSelf = self; [EZHttpUtil.sharedManager getCoverSwitchStatus:self.deviceInfo.deviceSerial completion:^(ResponseData * _Nonnull responseData) { if(responseData.success) { - NSLog(@"#############鎵撳嵃鏁版嵁锛�%@", responseData); + NSDictionary *dataDic = responseData.data; + if (dataDic && [[dataDic allKeys] containsObject:@"enable"]) { // 鍖呭惈闅愮閬斀鍔熻兘灞炴�� + weakSelf.privacyMaskSwitch.enabled = YES; + [weakSelf.privacyMaskSwitch setOn:[[dataDic objectForKey:@"enable"] boolValue]]; + } else { // 涓嶅寘鍚鍔熻兘 + weakSelf.privacyMaskSwitch.enabled = NO; + } + } else { + weakSelf.privacyMaskSwitch.enabled = NO; } }]; } @@ -195,6 +222,7 @@ cell.textLabel.textColor = HDLEZHEXCOLOR(0x1B2D4D, 1.0); cell.textLabel.textAlignment = NSTextAlignmentLeft; cell.accessoryType = UITableViewCellAccessoryNone; + cell.accessoryView = nil; if (indexPath.section == 0) { [cell.contentView addSubview:self.nameLabel]; @@ -235,14 +263,27 @@ } else if (indexPath.section == 6) { - [cell.contentView addSubview:self.privacyMaskSwitch]; - [self.privacyMaskSwitch mas_remakeConstraints:^(MASConstraintMaker *make) { - make.trailing.mas_equalTo(@(-17)); - make.centerY.mas_equalTo(cell.contentView.mas_centerY); - make.width.mas_equalTo(@51); - make.height.mas_equalTo(@31); - }]; - self.privacyMaskSwitch.on = !self.privacyMaskSwitch.on; + if (self.isCatEye) { // 鐚溂 + cell.backgroundColor = [UIColor clearColor]; + cell.contentView.backgroundColor = [UIColor clearColor]; + cell.textLabel.text = @""; + [cell.contentView addSubview:self.deleteButton]; + [self.deleteButton addTarget:self action:@selector(deleteAction) forControlEvents:UIControlEventTouchUpInside]; + [self.deleteButton mas_remakeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(cell.contentView.mas_centerX); + make.left.mas_equalTo(cell.contentView.mas_left).offset(77.); + make.bottom.mas_equalTo(cell.contentView.mas_bottom); + make.height.mas_equalTo(@44); + }]; + } else { // 鎽勫儚澶� + [cell.contentView addSubview:self.privacyMaskSwitch]; + [self.privacyMaskSwitch mas_remakeConstraints:^(MASConstraintMaker *make) { + make.trailing.mas_equalTo(@(-17)); + make.centerY.mas_equalTo(cell.contentView.mas_centerY); + make.width.mas_equalTo(@51); + make.height.mas_equalTo(@31); + }]; + } } else if (indexPath.section == 7) { @@ -321,7 +362,7 @@ } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - return (indexPath.section == 8) ? 92 : 50.; + return ((!self.isCatEye && indexPath.section == 8) || (self.isCatEye && indexPath.section == 6)) ? 92 : 50.; } - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { @@ -329,7 +370,7 @@ } - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { - return (section == 0 || section == 2 || section == 6) ? 8.0f : 0.001f; + return (section == 0 || section == 2 || (!self.isCatEye && section == 6)) ? 8.0f : 0.001f; } - (nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { @@ -382,13 +423,17 @@ UIAlertController *alert=[UIAlertController alertControllerWithTitle:HDLEZLocallizedString(@"alert_title") message:HDLEZLocallizedString(@"setting_formatting_alert_message") preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *cancle=[UIAlertAction actionWithTitle:HDLEZLocallizedString(@"device_temp_cancle") style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { }]; - __weak __typeof(self)weakSelf = self; UIAlertAction *sure=[UIAlertAction actionWithTitle:HDLEZLocallizedString(@"device_temp_sure") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { [EZOPENSDK formatStorage:self.deviceInfo.deviceSerial storageIndex:0 completion:^(NSError *error) { - NSLog(@"format command error = %@", error); - [UIView dd_showMessage:error.description]; + if (error) { + NSLog(@"format command error = %@", error); + [UIView dd_showMessage:NSLocalizedString(@"setting_sd_card_fail", @"鏍煎紡鍖栧け璐ワ紝璇烽噸鏂板啀璇�")]; + } else { + NSLog(@"format command error = %@", error); + [UIView dd_showMessage:NSLocalizedString(@"setting_sd_card_success", @"鏍煎紡鍖栨垚鍔�")]; + } }]; }]; [alert addAction:cancle]; @@ -588,6 +633,37 @@ - (IBAction)privacyMasking:(id)sender { UISwitch *pmSwitch = (UISwitch*)sender; BOOL status = pmSwitch.isOn; + +// if (self.privacyMasking) { +// self.privacyMaskSwitch.on = !status; +// [UIView dd_showMessage:@"姝e湪鎵ц涓紝璇风◢鍚庡啀璇�"]; +// return; +// } +// +// NSLog(@"#############璁剧疆鐘舵�侊細%@", status ? @"寮�鍚�" : @"鍏抽棴"); + __weak __typeof(self)weakSelf = self; + self.privacyMaskSwitch.enabled = NO; + self.privacyMaskButton.hidden = NO; + [self performSelector:@selector(delayPrivacyMasking) withObject:nil afterDelay:10.0]; + [EZHttpUtil.sharedManager coverSwitchStatus:self.deviceInfo.deviceSerial enable:(status ? 1 : 0) completion:^(ResponseData * _Nonnull responseData) { + if(responseData.success) { + NSLog(@"#############璁剧疆鎴愬姛锛�%@", responseData.data); + } else { + NSLog(@"#############璁剧疆澶辫触锛�%@", responseData.message); + [UIView dd_showMessage:NSLocalizedString(@"setting_privacy_masking_fail", @"璁剧疆澶辫触锛岃绋嶅悗鍐嶈瘯")]; + [weakSelf.privacyMaskSwitch setOn:!status]; + } + weakSelf.privacyMaskSwitch.enabled = YES; + }]; +} + +- (void)privacyMaskingAction:(id)sender { + [UIView dd_showMessage:NSLocalizedString(@"setting_privacy_masking_ing", @"姝e湪鎵ц涓紝璇风◢鍚庡啀璇�")]; +} + +- (void)delayPrivacyMasking { + self.privacyMaskButton.hidden = YES; +// self.privacyMaskSwitch.enabled = YES; } - (IBAction)encryptChanged:(id)sender @@ -653,4 +729,13 @@ return _deleteButton; } +- (UIButton *)privacyMaskButton { + if (!_privacyMaskButton) { + _privacyMaskButton = [UIButton buttonWithType:UIButtonTypeCustom]; + _privacyMaskButton.backgroundColor = [UIColor clearColor]; + _privacyMaskButton.hidden = YES; + } + return _privacyMaskButton; +} + @end -- Gitblit v1.8.0