From 011b0cc918bfa0e36a9ad4a0f45c18b801815920 Mon Sep 17 00:00:00 2001 From: Davin <591807572@qq.com> Date: 星期四, 15 六月 2023 21:00:36 +0800 Subject: [PATCH] faeture 历史消息 --- EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZVideoDoorMsgCell.h | 24 +++ EZDemo/HDLEZDemo/HDLEZDemo/libEZSDK.a | 0 EZSDK/EZSDK.xcodeproj/project.pbxproj | 6 EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.h | 4 EZSDK/EZSDK/EZ/Venders/MWPhotoBrowser/MWPhotoBrowser.h | 11 + EZDemo/HDLEZDemo/HDLEZDemo/resources/zh-Hans.lproj/Localizable.strings | 76 +++++++++- EZSDK/EZSDK/EZ/Venders/MWPhotoBrowser/MWPhotoBrowser.m | 39 +++++ EZDemo/HDLEZDemo/HDLEZDemo/Info.plist | 4 EZSDK/EZSDK/EZ/TempPassword/Controllers/HDLEZDeviceMsgListViewController.m | 74 ++++++++++ EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.m | 48 ++++++ EZDemo/HDLEZDemo/HDLEZDemo/resources/en.lproj/Localizable.strings | 1 EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZVideoDoorMsgCell.m | 122 +++++++++++++++++ 12 files changed, 393 insertions(+), 16 deletions(-) diff --git a/EZDemo/HDLEZDemo/HDLEZDemo/Info.plist b/EZDemo/HDLEZDemo/HDLEZDemo/Info.plist index 1666eda..c890e35 100644 --- a/EZDemo/HDLEZDemo/HDLEZDemo/Info.plist +++ b/EZDemo/HDLEZDemo/HDLEZDemo/Info.plist @@ -6,6 +6,10 @@ <string></string> <key>NSMicrophoneUsageDescription</key> <string>楹﹀厠椋�</string> + <key>NSPhotoLibraryUsageDescription</key> + <string>姝� App 闇�瑕佹偍鐨勫悓鎰忔墠鑳借鍙栧獟浣撹祫鏂欏簱</string> + <key>NSPhotoLibraryAddUsageDescription</key> + <string>姝� App 闇�瑕佹偍鐨勫悓鎰忔墠鑳借鍙栧獟浣撹祫鏂欏簱</string> <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> diff --git a/EZDemo/HDLEZDemo/HDLEZDemo/libEZSDK.a b/EZDemo/HDLEZDemo/HDLEZDemo/libEZSDK.a index 0813048..a65e682 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 2099044..0f496ef 100644 --- a/EZDemo/HDLEZDemo/HDLEZDemo/resources/en.lproj/Localizable.strings +++ b/EZDemo/HDLEZDemo/HDLEZDemo/resources/en.lproj/Localizable.strings @@ -224,3 +224,4 @@ //閫氱敤 "hdl_ez_common_no_data"="No Data"; +"hdl_ez_download"="Download"; diff --git a/EZDemo/HDLEZDemo/HDLEZDemo/resources/zh-Hans.lproj/Localizable.strings b/EZDemo/HDLEZDemo/HDLEZDemo/resources/zh-Hans.lproj/Localizable.strings index 5a741a3..8272092 100644 --- a/EZDemo/HDLEZDemo/HDLEZDemo/resources/zh-Hans.lproj/Localizable.strings +++ b/EZDemo/HDLEZDemo/HDLEZDemo/resources/zh-Hans.lproj/Localizable.strings @@ -1,11 +1,3 @@ -/* - Localizable.strings - EZOpenSDK - - Created by linyong on 2017/9/7. - Copyright 漏 2017骞� Ezviz. All rights reserved. -*/ - "done"="纭畾"; "cancel"="鍙栨秷"; @@ -35,6 +27,9 @@ "ad_added_by_others"="姝よ澶囧凡琚埆浜烘坊鍔�"; "get_info_fail"="鏌ヨ澶辫触锛岀綉缁滀笉缁欏姏"; "ad_input_manual"="鎵嬪姩杈撳叆"; + +"ad_result_verify_local_lock"="璇峰湪2鍒嗛挓涔嬪唴鏍¢獙宸叉坊鍔犵殑涓荤敤鎴锋寚绾广�佸瘑閽ユ垨鎰熷簲鍗★紝鏍¢獙瀹屾垚璇风偣鍑诲凡鏍¢獙鎸夐挳"; +"ad_verified"="宸叉牎楠�"; "device_camera_list_title"="璁惧閫氶亾鍒楄〃"; "device_input_vierify_code"="璇疯緭鍏ヨ澶囬獙璇佺爜"; @@ -71,6 +66,48 @@ "device_password"="瀵嗙爜"; "device_account_pw_empty"="甯愬彿鎴栧瘑鐮佷笉鑳戒负绌�"; "device_lan_preview_title"="灞�鍩熺綉棰勮"; +"device_add_device_qr_code"="璁惧浜岀淮鐮�"; + +"device_open"="寮�闂�"; +"device_open_success"="寮�闂ㄦ垚鍔燂紒"; +"device_please_input_door_password"="璇疯緭鍏ュ紑閿佸瘑鐮�"; +"device_history"="鍘嗗彶璁板綍"; +"device_his_no_more_data"="娌℃湁鏇村鏁版嵁"; +"device_temp_pass"="涓存椂瀵嗙爜"; +"device_temp_year"="骞�"; +"device_temp_month"="鏈�"; +"device_temp_date"="鏃�"; +"device_temp_left"="鍓╀綑"; +"device_temp_times"="娆�"; +"device_temp_save"="淇濆瓨"; +"device_temp_user"="浣跨敤浜�"; +"device_temp_valid_date"="鏈夋晥鏈�"; +"device_temp_valid_begin"="寮�濮�"; +"device_temp_valid_end"="缁撴潫"; +"device_temp_use_times"="浣跨敤娆℃暟"; +"device_temp_please_select"="璇烽�夋嫨"; +"device_temp_unlimited_times"="涓嶉檺"; +"device_temp_sure"="纭"; +"device_temp_cancle"="鍙栨秷"; +"device_temp_please_input"="璇疯緭鍏�"; +"device_temp_input_use_count_describe"="杈撳叆1鍒�100鐨勬暣鏁帮紝 涓虹┖琛ㄧず涓嶉檺娆℃暟"; +"device_temp_input_pure_number"="璇疯緭鍏ョ函鏁板瓧"; +"device_temp_input_valid_number"="璇疯緭鍏�1-100涔嬮棿鐨勬暟瀛�"; +"device_temp_unit_year"="骞�"; +"device_temp_unit_month"="鏈�"; +"device_temp_unit_date"="鏃�"; +"device_temp_unit_hour"="鏃�"; +"device_temp_unit_minute"="鍒�"; +"device_temp_please_input_user_name"="璇疯緭鍏ヤ娇鐢ㄤ汉"; +"device_temp_please_select_begin_time"="璇烽�夋嫨寮�濮嬫椂闂�"; +"device_temp_please_select_end_time"="璇烽�夋嫨缁撴潫鏃堕棿"; +"device_temp_please_end_time_should_later"="缁撴潫鏃堕棿涓嶅緱鏃╀簬寮�濮嬫椂闂�"; +"device_temp_unlimited_use_times"="涓嶉檺娆℃暟"; +"device_temp_total"="鎬绘暟"; +"device_temp_copied"="宸插鍒�"; +"device_temp_long_tap_copy"="闀挎寜澶嶅埗涓存椂瀵嗙爜"; +"device_temp_sure_to_delete"="纭鍒犻櫎涓存椂瀵嗙爜鍚楋紵"; + "dmessage_title"="娑堟伅"; "message_read"="鏍囪宸茶"; @@ -129,6 +166,25 @@ "wifi_device_start_ready"="璁惧宸插惎鍔ㄥソ锛屼笖鏄涓�娆¢厤缃綉缁�"; "wifi_config_wifi_ago"="杩欏彴璁惧浠ュ墠閰嶈繃缃戠粶"; +"wifi_config_seria_num"="璁惧鏈鸿韩涓婄殑9浣嶅簭鍒楀彿"; +"wifi_config_verify_code"="楠岃瘉鐮�"; +"wifi_config_connected"="鎴戝凡杩炴帴濂�"; +"wifi_config_select_set_param"="閫夋嫨\"璁剧疆鍙傛暟\""; +"wifi_config_select_wifi"="閫夋嫨\"Wi-Fi\""; +"wifi_config_net_work"="閰嶇疆缃戠粶"; +"wifi_config_name"="鍚嶇О锛�"; +"wifi_config_copy_pwd"="澶嶅埗瀵嗙爜"; +"wifi_config_to_setting"="杩涘叆璁剧疆椤甸潰"; +"wifi_config_step_three"="杩斿洖APP锛岀瓑寰呬笌璁惧杩炴帴锛屾垚鍔熷悗鑷姩杩涘叆涓嬩竴姝ユ搷浣溿��"; +"wifi_config_tip"="璇烽�氳繃涓嬪垪姝ラ灏嗘墜鏈鸿繛鎺ュ埌璁惧Wi-Fi锛�"; +"wifi_config_step_three_tip"="(娉ㄦ剰锛氬鏋滆澶嘩IFI鍚嶇О涓嶆槸鈥淓ZVIZ鈥濆墠缂�鐨勶紝璇峰鍒跺瘑鐮佸悗鏍规嵁鏂扮殑鍓嶇紑鍚嶅瓧锛屾墜鍔ㄤ慨鏀瑰瘑鐮佺殑鍓嶇紑骞惰繛鎺ュ嵆鍙�備緥濡傗�淪oftAP_XXXXXXX鈥�)"; +"wifi_config_not_connected"="灏氭湭杩炴帴缃戠粶"; +"wifi_config_step_1_tips"="寰呰繛鎺ョ殑璁惧Wi-Fi淇℃伅濡備笅锛�"; +"wifi_config_step_2_tips"="濡傛灉浣犱娇鐢ㄧ殑鏄弻棰戣矾鐢卞櫒锛岃涓嶈璁╂憚鍍忔満杩炴帴5G棰戞鐨刉i-Fi"; +"wifi_config_step_2_next_step"="涓嬩竴姝�"; +"wifi_config_step_2_net"="缃戠粶锛�"; +"wifi_config_step_2_password"="瀵嗙爜锛�"; + "ui_last_update"="鏈�鍚庢洿鏂帮細"; "ui_last_update_empty"="鏈�鍚庢洿鏂帮細鏃犺褰�"; "ui_just_now"="鍒氬垰"; @@ -166,3 +222,7 @@ //2021-01-27 鏂板 "Devicelist"="璁惧鍒楄〃"; "Logout"="娉ㄩ攢"; + +//閫氱敤 +"hdl_ez_common_no_data"="鏆傛棤鏁版嵁"; +"hdl_ez_download"="涓嬭浇"; diff --git a/EZSDK/EZSDK.xcodeproj/project.pbxproj b/EZSDK/EZSDK.xcodeproj/project.pbxproj index 6961447..5930dbe 100644 --- a/EZSDK/EZSDK.xcodeproj/project.pbxproj +++ b/EZSDK/EZSDK.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 830957C32A3AE3E1002B68AA /* HDLEZVideoDoorMsgCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 830957C22A3AE3E1002B68AA /* HDLEZVideoDoorMsgCell.m */; }; AE31FE1F29CC2D2200678568 /* EZOpenSDKFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE31FE1E29CC2D2200678568 /* EZOpenSDKFramework.framework */; platformFilter = ios; }; AE5068D829B9DB5E009EA09A /* HDLEZTemInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = AE5068D729B9DB5E009EA09A /* HDLEZTemInfoModel.m */; }; AEC306D229B9F2B5000B3861 /* HDLEZVisitorRecordView.m in Sources */ = {isa = PBXBuildFile; fileRef = AEC306D129B9F2B5000B3861 /* HDLEZVisitorRecordView.m */; }; @@ -184,6 +185,8 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 830957C12A3AE3E1002B68AA /* HDLEZVideoDoorMsgCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HDLEZVideoDoorMsgCell.h; sourceTree = "<group>"; }; + 830957C22A3AE3E1002B68AA /* HDLEZVideoDoorMsgCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HDLEZVideoDoorMsgCell.m; sourceTree = "<group>"; }; AE31FE1E29CC2D2200678568 /* EZOpenSDKFramework.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = EZOpenSDKFramework.framework; sourceTree = "<group>"; }; AE5068D629B9DB5E009EA09A /* HDLEZTemInfoModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HDLEZTemInfoModel.h; sourceTree = "<group>"; }; AE5068D729B9DB5E009EA09A /* HDLEZTemInfoModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HDLEZTemInfoModel.m; sourceTree = "<group>"; }; @@ -661,6 +664,8 @@ AEDBFBA129C302E0005F6512 /* HDLEZDeviceMsgListView.m */, AEDBFBA329C3072D005F6512 /* HDLEZDeviceMsgCell.h */, AEDBFBA429C3072D005F6512 /* HDLEZDeviceMsgCell.m */, + 830957C12A3AE3E1002B68AA /* HDLEZVideoDoorMsgCell.h */, + 830957C22A3AE3E1002B68AA /* HDLEZVideoDoorMsgCell.m */, ); path = Views; sourceTree = "<group>"; @@ -1567,6 +1572,7 @@ B9EA4E8B25C7E806000FFDA2 /* MJRefreshBackStateFooter.m in Sources */, B9BC99A125C0FFBD00C024FE /* DDCollectionViewFlowLayout.m in Sources */, B9BC9A1E25C0FFBD00C024FE /* EZWifiInfoViewController.m in Sources */, + 830957C32A3AE3E1002B68AA /* HDLEZVideoDoorMsgCell.m in Sources */, AEF0148F29C188ED00D014FD /* HDLEZScrollView.m in Sources */, B9BC9A1925C0FFBD00C024FE /* EZAPWiFiConfigViewController.m in Sources */, B95AB88826984DD5007BC8D7 /* YYClassInfo.m in Sources */, diff --git a/EZSDK/EZSDK/EZ/TempPassword/Controllers/HDLEZDeviceMsgListViewController.m b/EZSDK/EZSDK/EZ/TempPassword/Controllers/HDLEZDeviceMsgListViewController.m index 0c1ca3e..da4e342 100644 --- a/EZSDK/EZSDK/EZ/TempPassword/Controllers/HDLEZDeviceMsgListViewController.m +++ b/EZSDK/EZSDK/EZ/TempPassword/Controllers/HDLEZDeviceMsgListViewController.m @@ -10,7 +10,10 @@ #import "MJRefreshNormalHeader.h" #import "MJRefreshAutoNormalFooter.h" #import "HDLEZDevMsgListModel.h" -@interface HDLEZDeviceMsgListViewController () +#import "MWPhotoBrowser.h" +#import "SDWebImageManager.h" +#import <Photos/Photos.h> +@interface HDLEZDeviceMsgListViewController ()<MWPhotoBrowserDelegate> @property (nonatomic, strong) HDLEZDeviceMsgListView *msgListV;//娑堟伅鍒楄〃view @property (nonatomic, strong) MJRefreshNormalHeader *header;//鍒锋柊header @@ -25,6 +28,8 @@ @property (nonatomic, assign) NSInteger pageSize;//鍒嗛〉瀹归噺 +@property (nonatomic, strong) NSMutableArray <MWPhoto *>*photos; // 棰勮鍥剧墖淇℃伅 + @end @implementation HDLEZDeviceMsgListViewController @@ -45,7 +50,10 @@ make.top.equalTo(self.view).offset(HDLEZ_APP_TOP_BAR_HEIGHT); make.left.bottom.right.equalTo(self.view); }]; -// _msgListV.choseDelegate=self; + __weak __typeof(self)weakSelf = self; + [_msgListV previewPicture:^(NSString * _Nonnull pictureUrl) { + [weakSelf previewPictureWithUrl:pictureUrl]; + }]; //涓嬫媺鍒锋柊 // 璁剧疆鍥炶皟锛堜竴鏃﹁繘鍏ュ埛鏂扮姸鎬侊紝灏辫皟鐢╰arget鐨刟ction锛屼篃灏辨槸璋冪敤self鐨刲oadNewData鏂规硶锛� @@ -117,5 +125,67 @@ }]; } +#pragma mark MWPhotoBrowserDelegate +- (NSUInteger)numberOfPhotosInPhotoBrowser:(MWPhotoBrowser *)photoBrowser { + return self.photos.count; +} + +- (id <MWPhoto>)photoBrowser:(MWPhotoBrowser *)photoBrowser photoAtIndex:(NSUInteger)index { + if (index < self.photos.count) { + return [self.photos objectAtIndex:index]; + } + return nil; +} + +- (void)didClickCurrentPhotoBrowserBlank:(MWPhotoBrowser *)photoBrowser { + [self.navigationController popToViewController:self animated:NO]; +} + +- (void)didClickDownLoad:(MWPhotoBrowser *)photoBrowser { + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + + NSURL *url = [NSURL URLWithString:@"https://upload-images.jianshu.io/upload_images/5809200-a99419bb94924e6d.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"]; + SDWebImageManager *manager = [SDWebImageManager sharedManager]; + UIImage *img; + if ([manager diskImageExistsForURL:url]) { + img = [[manager imageCache] imageFromDiskCacheForKey:url.absoluteString]; + } else { + //浠庣綉缁滀笅杞藉浘鐗� + NSData *data = [NSData dataWithContentsOfURL:url]; + img = [UIImage imageWithData:data]; + } + // 淇濆瓨鍥剧墖鍒扮浉鍐屼腑 + dispatch_async(dispatch_get_main_queue(), ^{ + UIImageWriteToSavedPhotosAlbum(img,self, @selector(image:didFinishSavingWithError + :contextInfo:),nil); + }); + }); +} + +//淇濆瓨鍥剧墖瀹屾垚涔嬪悗鐨勫洖璋� +- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error + contextInfo:(void *)contextInfo { + // Was there an error? + NSString *message = nil; + if (!error) { + message = NSLocalizedString(@"device_save_gallery", @"宸蹭繚瀛樿嚦鎵嬫満鐩稿唽"); + } + else + { + message = [error description]; + } + [UIView dd_showMessage:message]; +} + +#pragma mark PrivateMethod +- (void)previewPictureWithUrl:(NSString *)picUrl { + self.photos = [NSMutableArray array]; + [self.photos addObject:[MWPhoto photoWithURL:[NSURL URLWithString:picUrl]]]; + MWPhotoBrowser *browser = [[MWPhotoBrowser alloc] initWithDelegate:self]; + [browser showDownloadBtn]; + + [self.navigationController pushViewController:browser animated:NO]; +} + @end diff --git a/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.h b/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.h index e0f1e43..70835af 100644 --- a/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.h +++ b/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.h @@ -11,6 +11,10 @@ @interface HDLEZDeviceMsgListView : UITableView<UITableViewDelegate,UITableViewDataSource> @property (nonatomic, strong) NSArray<HDLEZDeviceMsgInfoModel*> *msgList;//娑堟伅鍒楄〃 + +/// - previewPic: 棰勮鍥剧墖鍥炶皟 +- (void)previewPicture:(void(^)(NSString *pictureUrl))previewPic; + @end NS_ASSUME_NONNULL_END diff --git a/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.m b/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.m index a8e76b8..5fc3518 100644 --- a/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.m +++ b/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.m @@ -7,6 +7,14 @@ #import "HDLEZDeviceMsgListView.h" #import "HDLEZDeviceMsgCell.h" +#import "HDLEZVideoDoorMsgCell.h" + +@interface HDLEZDeviceMsgListView () + +@property (copy, nonatomic) void(^previewPic)(NSString *pictureUrl); + +@end + @implementation HDLEZDeviceMsgListView{ CGFloat cellHeight; } @@ -21,7 +29,7 @@ self.showsVerticalScrollIndicator=NO; self.delegate = self; self.dataSource = self; - cellHeight=65; + cellHeight=80; [self setSeparatorInset:UIEdgeInsetsZero]; // [self setLayoutMargins:UIEdgeInsetsZero]; } @@ -43,18 +51,48 @@ -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ HDLEZLog(@"鍒濆鍖朿ell"); - HDLEZDeviceMsgCell *cell = [tableView dequeueReusableCellWithIdentifier:@"HDLEZDeviceMsgCell"]; + HDLEZVideoDoorMsgCell *cell = [tableView dequeueReusableCellWithIdentifier:@"HDLEZVideoDoorMsgCell"]; if(cell == nil){ - cell=[[HDLEZDeviceMsgCell alloc]initWithFrame:CGRectMake(0, 0, self.frame.size.width, cellHeight)]; + cell=[[HDLEZVideoDoorMsgCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"HDLEZVideoDoorMsgCell"]; } - HDLEZDeviceMsgInfoModel *model=self.msgList[indexPath.row]; - cell.msgInfo=model; + [self configCell:cell indexPath:indexPath]; +// HDLEZDeviceMsgCell *cell = [tableView dequeueReusableCellWithIdentifier:@"HDLEZDeviceMsgCell"]; +// if(cell == nil){ +// cell=[[HDLEZDeviceMsgCell alloc]initWithFrame:CGRectMake(0, 0, self.frame.size.width, cellHeight)]; +// } +// HDLEZDeviceMsgInfoModel *model=self.msgList[indexPath.row]; +// cell.msgInfo=model; // HDLEZLog(@"鍒濆鍖朿ell ID:%@",model.extVisitorId); return cell; } +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + if (self.msgList.count <= indexPath.row) return; + HDLEZDeviceMsgInfoModel *messageModel = self.msgList[indexPath.row]; +#warning mock + NSString *tempPicUrl = @"https://upload-images.jianshu.io/upload_images/5809200-a99419bb94924e6d.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"; + if (self.previewPic) { + self.previewPic(tempPicUrl); + } +} + +#pragma mark - PublishMethod +- (void)previewPicture:(void(^)(NSString *pictureUrl))previewPic { + self.previewPic = previewPic; +} + +#pragma mark - PrivateMethod +- (void)configCell:(HDLEZVideoDoorMsgCell *)cell indexPath:(NSIndexPath *)indexPath { + if (self.msgList.count <= indexPath.row) return; + + HDLEZDeviceMsgInfoModel *messageModel = self.msgList[indexPath.row]; +#warning mock + NSString *tempPicUrl = @"https://upload-images.jianshu.io/upload_images/5809200-a99419bb94924e6d.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"; + [cell configMessageInfoWithTitle:messageModel.title deviceStatus:@"鏈帴鍚�" messageTime:messageModel.createTime messageImage:tempPicUrl]; +} + /*璁剧疆娑堟伅鍒楄〃鍊� */ -(void)setMsgList:(NSArray<HDLEZDeviceMsgInfoModel *> *)msgList{ diff --git a/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZVideoDoorMsgCell.h b/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZVideoDoorMsgCell.h new file mode 100644 index 0000000..8a08c4f --- /dev/null +++ b/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZVideoDoorMsgCell.h @@ -0,0 +1,24 @@ +// +// HDLEZVideoDoorMsgCell.h +// EZSDK +// +// Created by Davin on 2023/6/15. +// + +#import <UIKit/UIKit.h> + +NS_ASSUME_NONNULL_BEGIN + +@interface HDLEZVideoDoorMsgCell : UITableViewCell + +/// 閰嶇疆闂ㄩ攣鍘嗗彶娑堟伅璁板綍 +/// - Parameters: +/// - title: 娑堟伅鏍囬 +/// - deviceStatus: 璁惧鐘舵�� +/// - time: 娑堟伅鐢熸垚鏃堕棿 +/// - messageUrl: 娑堟伅鍥剧墖 +- (void)configMessageInfoWithTitle:(NSString *)title deviceStatus:(NSString *)deviceStatus messageTime:(NSString *)time messageImage:(NSString *)messageUrl; + +@end + +NS_ASSUME_NONNULL_END diff --git a/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZVideoDoorMsgCell.m b/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZVideoDoorMsgCell.m new file mode 100644 index 0000000..8c7c701 --- /dev/null +++ b/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZVideoDoorMsgCell.m @@ -0,0 +1,122 @@ +// +// HDLEZVideoDoorMsgCell.m +// EZSDK +// +// Created by Davin on 2023/6/15. +// + +#import "HDLEZVideoDoorMsgCell.h" + +@interface HDLEZVideoDoorMsgCell () + +@property (strong, nonatomic) UILabel *messageTitle; +@property (strong, nonatomic) UILabel *statusLabel; +@property (strong, nonatomic) UILabel *timeLabel; +@property (strong, nonatomic) UIImageView *messageImageView; + +@end + +@implementation HDLEZVideoDoorMsgCell + +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { + if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { + [self createSubviews]; + } + return self; +} + +- (void)createSubviews { + self.contentView.backgroundColor = UIColor.whiteColor; + [self.contentView addSubview:self.messageTitle]; + [self.contentView addSubview:self.statusLabel]; + [self.contentView addSubview:self.timeLabel]; + [self.contentView addSubview:self.messageImageView]; + + [self.messageTitle mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.contentView.mas_top).offset(16.); + make.left.mas_equalTo(self.contentView.mas_left).offset(16.); + make.height.mas_equalTo(22); + }]; + + [self.statusLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.messageTitle.mas_bottom).offset(10.); + make.left.mas_equalTo(self.messageTitle.mas_left); + make.width.mas_equalTo(50); + make.height.mas_equalTo(30); + }]; + + [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.messageTitle.mas_left); + make.bottom.mas_equalTo(self.messageImageView.mas_bottom); + make.right.mas_equalTo(self.messageTitle.mas_right); + make.height.mas_equalTo(22); + }]; + + [self.messageImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.contentView.mas_top).offset(16.); + make.left.mas_equalTo(self.messageTitle.mas_right).offset(10.); + make.bottom.mas_equalTo(self.contentView.mas_bottom).offset(-16.); + make.right.mas_equalTo(self.contentView.mas_right).offset(-16.); + make.width.mas_equalTo(self.messageImageView.mas_height).multipliedBy(5/3.); + }]; +} + +#pragma mark - PublishMethod +- (void)configMessageInfoWithTitle:(NSString *)title deviceStatus:(NSString *)deviceStatus messageTime:(NSString *)time messageImage:(NSString *)messageUrl { + if (title && title.length > 0) { + self.messageTitle.text = title; + } + if (deviceStatus && deviceStatus.length > 0) { + self.statusLabel.text = deviceStatus; + } + if (time && time.length > 0) { + self.timeLabel.text = time; + } + if (messageUrl && messageUrl.length > 0) { + NSLog(@"#######cell image url:%@", messageUrl); + [self.messageImageView sd_setImageWithURL:[NSURL URLWithString:messageUrl] placeholderImageScale:[UIImage imageNamed:@""]]; + } +} + +#pragma mark - Getter +- (UILabel *)messageTitle { + if (!_messageTitle) { + _messageTitle=[[UILabel alloc] init]; + _messageTitle.font = HDLEZ_Get_FontRegularWithSize(HDLEZ_FontSize_14); + _messageTitle.textColor=HDLEZ_COLOR_TITLE_BLACK; + } + return _messageTitle; +} + +- (UILabel *)statusLabel { + if (!_statusLabel) { + _statusLabel=[[UILabel alloc] init]; + _statusLabel.font = HDLEZ_Get_FontRegularWithSize(HDLEZ_FontSize_12); + _statusLabel.textColor = HDLEZ_COLOR_TEXT_LIGHT_GRAY; + _statusLabel.layer.cornerRadius = 5; + _statusLabel.layer.borderColor = HDLEZ_COLOR_TEXT_GRAY.CGColor; + _statusLabel.clipsToBounds = YES; + } + return _statusLabel; +} + +- (UILabel *)timeLabel { + if (!_timeLabel) { + _timeLabel=[[UILabel alloc] init]; + _timeLabel.font = HDLEZ_Get_FontRegularWithSize(HDLEZ_FontSize_12); + _timeLabel.textColor=HDLEZ_COLOR_TEXT_GRAY; + _timeLabel.textAlignment = NSTextAlignmentRight; + } + return _timeLabel; +} + +- (UIImageView *)messageImageView { + if (!_messageImageView) { + _messageImageView = [[UIImageView alloc] init]; + _messageImageView.backgroundColor = HDLEZ_COLOR_TEXT_LIGHT_GRAY; + + } + return _messageImageView; +} + +@end diff --git a/EZSDK/EZSDK/EZ/Venders/MWPhotoBrowser/MWPhotoBrowser.h b/EZSDK/EZSDK/EZ/Venders/MWPhotoBrowser/MWPhotoBrowser.h index 4225f9c..1ccaead 100644 --- a/EZSDK/EZSDK/EZ/Venders/MWPhotoBrowser/MWPhotoBrowser.h +++ b/EZSDK/EZSDK/EZ/Venders/MWPhotoBrowser/MWPhotoBrowser.h @@ -35,6 +35,13 @@ - (BOOL)photoBrowser:(MWPhotoBrowser *)photoBrowser isPhotoSelectedAtIndex:(NSUInteger)index; - (void)photoBrowser:(MWPhotoBrowser *)photoBrowser photoAtIndex:(NSUInteger)index selectedChanged:(BOOL)selected; - (void)photoBrowserDidFinishModalPresentation:(MWPhotoBrowser *)photoBrowser; +/// OnPro2.0鐗堟湰娣诲姞鍗曞嚮浜嬩欢 +/// - Parameter photoBrowser: 褰撳墠鍥剧墖瀵硅薄 +- (void)didClickCurrentPhotoBrowserBlank:(MWPhotoBrowser *)photoBrowser; + +/// OnPro2.0鐗堟湰娣诲姞涓嬭浇鍔熻兘 +/// - Parameter photoBrowser: 褰撳墠棰勮瀵硅薄 +- (void)didClickDownLoad:(MWPhotoBrowser *)photoBrowser; @end @@ -72,4 +79,8 @@ - (void)showNextPhotoAnimated:(BOOL)animated; - (void)showPreviousPhotoAnimated:(BOOL)animated; +// Expansion +/// 灞曠ず涓嬭浇鎸夐挳 OnPro2.0 娣诲姞浜� 23.06.15 +- (void)showDownloadBtn; + @end diff --git a/EZSDK/EZSDK/EZ/Venders/MWPhotoBrowser/MWPhotoBrowser.m b/EZSDK/EZSDK/EZ/Venders/MWPhotoBrowser/MWPhotoBrowser.m index aeb581b..0943765 100644 --- a/EZSDK/EZSDK/EZ/Venders/MWPhotoBrowser/MWPhotoBrowser.m +++ b/EZSDK/EZSDK/EZ/Venders/MWPhotoBrowser/MWPhotoBrowser.m @@ -17,6 +17,12 @@ static void * MWVideoPlayerObservation = &MWVideoPlayerObservation; +@interface MWPhotoBrowser () + +@property (nonatomic, strong) UIButton *downloadBtn; + +@end + @implementation MWPhotoBrowser #pragma mark - Init @@ -1503,7 +1509,12 @@ - (BOOL)areControlsHidden { return (_toolbar.alpha == 0); } - (void)hideControls { [self setControlsHidden:YES animated:YES permanent:NO]; } - (void)showControls { [self setControlsHidden:NO animated:YES permanent:NO]; } -- (void)toggleControls { [self setControlsHidden:![self areControlsHidden] animated:YES permanent:NO]; } +- (void)toggleControls { + [self setControlsHidden:![self areControlsHidden] animated:YES permanent:NO]; + if ([self.delegate respondsToSelector:@selector(didClickCurrentPhotoBrowserBlank:)]) { + [self.delegate didClickCurrentPhotoBrowserBlank:self]; + } +} #pragma mark - Properties @@ -1639,4 +1650,30 @@ self.navigationController.navigationBar.userInteractionEnabled = YES; } +- (UIButton *)downloadBtn { + if (!_downloadBtn) { + _downloadBtn = [UIButton buttonWithType:UIButtonTypeCustom]; + [_downloadBtn setTitle:HDLEZLocallizedString(@"hdl_ez_download") forState:UIControlStateNormal]; + [_downloadBtn setTitleColor:HDLEZ_COLOR_TEXT_LIGHT_GRAY forState:UIControlStateNormal]; + } + return _downloadBtn; +} + +- (void)showDownloadBtn { + [self.view addSubview:self.downloadBtn]; + [self.downloadBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.view.mas_left).offset(32.); + make.bottom.mas_equalTo(self.view.mas_bottom).offset(-HDLEZ_APP_TAB_BOTTOM_HEIGHT - 16); + make.width.mas_equalTo((HDLEZ_APP_SCREEN_WIDTH - 96) / 2.); + make.height.mas_equalTo(50.); + }]; + [self.downloadBtn addTarget:self action:@selector(downLoadAction) forControlEvents:UIControlEventTouchUpInside]; +} + +- (void)downLoadAction { + if (self.delegate && [self.delegate respondsToSelector:@selector(didClickDownLoad:)]) { + [self.delegate didClickDownLoad:self]; + } +} + @end -- Gitblit v1.8.0