萤石云 iOSSDK,移植跨平台相关工程
Davin
2023-06-21 413b74eb37fa6b9e7ae38b22e8d777a74bd7a972
EZSDK/EZSDK/EZ/TempPassword/Controllers/HDLEZDeviceMsgListViewController.m
@@ -28,7 +28,8 @@
@property (nonatomic, assign) NSInteger pageSize;//分页容量
@property (nonatomic, strong) NSMutableArray <MWPhoto *>*photos;   // 预览图片信息
@property (nonatomic, strong) NSMutableArray <MWPhoto *>*photos;    // 预览图片信息
@property (nonatomic, strong) NSString *currentPreviewPhoto;        // 当前预览的图片
    
@end
@@ -114,6 +115,31 @@
                weakSelf.msgListV.msgList=weakSelf.msgList;
                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];
            }
            
@@ -143,8 +169,11 @@
- (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"];
        if (!self.currentPreviewPhoto || self.currentPreviewPhoto.length == 0) {
            [UIView dd_showMessage:NSLocalizedString(@"device_save_gallery_failure", @"下载失败")];
            return;
        }
        NSURL *url = [NSURL URLWithString:self.currentPreviewPhoto];
        SDWebImageManager *manager = [SDWebImageManager sharedManager];
        UIImage *img;
        if ([manager diskImageExistsForURL:url]) {
@@ -179,6 +208,7 @@
#pragma mark PrivateMethod
- (void)previewPictureWithUrl:(NSString *)picUrl {
    self.currentPreviewPhoto = picUrl;
    self.photos = [NSMutableArray array];
    [self.photos addObject:[MWPhoto photoWithURL:[NSURL URLWithString:picUrl]]];
    MWPhotoBrowser *browser = [[MWPhotoBrowser alloc] initWithDelegate:self];