Commit f58f7c24 authored by Sandy's avatar Sandy

评论提交增加图片。

parent b5bec041
......@@ -57,4 +57,14 @@
*/
@property (nonatomic,strong) CustomTOForumReplyEntity *replyEntity;
/**
附件栏
*/
@property (weak, nonatomic) IBOutlet UIView *attachmentView;
/**
附件栏高度
*/
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *layoutAttHeight;
@end
......@@ -20,8 +20,18 @@
make.size.mas_equalTo(CGSizeMake(0, 30));
make.centerY.equalTo(self.optionButton);
}];
for (UIImageView *obj in self.attachmentView.subviews) {
if ([obj isKindOfClass:[UIImageView class]]) {
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapImage:)];
[obj addGestureRecognizer:tap];
}
}
}
- (void)tapImage:(UIGestureRecognizer *)tap {
NSLog(@"%lu", tap.view.tag);
}
#pragma mark - 选项按钮
- (IBAction)extensionButtonClickAction:(UIButton *)sender {
if (self.bestView.width != 0) {
......
......@@ -13,13 +13,12 @@
- (void)awakeFromNib {
[super awakeFromNib];
[self setUpToolView];
}
#pragma mark - ToolView
- (void)setUpToolView
{
- (void)setUpToolView {
KeyBoardAccessoryView *toolView = [[KeyBoardAccessoryView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 44)];
toolView.delegate = self;
self.contentTextView.inputAccessoryView = toolView;
......@@ -27,45 +26,37 @@
}
#pragma mark - Click
- (void)extensionButtonClick:(UIButton *)sender
{
- (void)extensionButtonClick:(UIButton *)sender {
switch (sender.tag) {
case Camera:
{
case Camera: {
if ([self.delgate respondsToSelector:@selector(showCameraAction)]) {
[self.delgate showCameraAction];
}
}
break;
case PhotoAlbum:
{
} break;
case PhotoAlbum: {
if ([self.delgate respondsToSelector:@selector(showPhotoAlbumAction)]) {
[self.delgate showPhotoAlbumAction];
}
}
break;
case Emoji:
{
} break;
case Emoji: {
sender.selected = !sender.selected;
if (sender.selected) {
[[STEmojiKeyboard keyboard] setTextView:self.contentTextView];
}else {
} else {
[self.contentTextView setInputView:nil];
}
[self.contentTextView reloadInputViews];
[self.contentTextView becomeFirstResponder];
}
break;
} break;
default:
break;
}
}
#pragma mark - <UITextViewDelegate>
- (void)textViewDidEndEditing:(UITextView *)textView
{
- (void)textViewDidEndEditing:(UITextView *)textView {
self.heightConstraint.constant = [self calculateStudyIntroductionHeight:textView.text];
if ([self.delgate respondsToSelector:@selector(refreshHeight:)]) {
[self.delgate refreshHeight:self.contentTextView.height];
......@@ -73,22 +64,9 @@
}
#pragma mark - 计算高度
- (CGFloat)calculateStudyIntroductionHeight:(NSString *)content
{
return [content heightWithFontSize:14 width:ScreenWidth-40]+20;
- (CGFloat)calculateStudyIntroductionHeight:(NSString *)content {
return [content heightWithFontSize:14 width:ScreenWidth - 40] + 20;
}
@end
......@@ -75,7 +75,7 @@
TOForumCategoryEntity *category = self.result.list[indexPath.row];
category.typeId = self.result.forumType.fid;
itemListVc.category = category;
itemListVc.isPosting = [category.name isEqualToString:@"欧普问问"]?0:1;
itemListVc.isPosting = [category.name isEqualToString:@"欧普问问"]?2:1;
[self.navigationController pushViewController:itemListVc animated:YES];
}
......
......@@ -13,7 +13,9 @@
#import "WkWebViewViewController.h"
#import "AnnouncementContentTableViewCell.h"
#import "ForumDetailPhotoTableViewCell.h"
#import "ZJKeyBoardAccessoryView.h"
#import "ForumDetailBottomView.h"
#import "OSSHelper.h"
@interface ForumItemDetailViewController ()<UITableViewDelegate,UITableViewDataSource,UITextFieldDelegate,TapClickDelegate,ReturnTableviewcellIndexpathdelegate>
......@@ -70,6 +72,13 @@
@property (nonatomic,strong) ForumReplyCondition *condition;
/**
底部的view
*/
@property (weak, nonatomic) IBOutlet ForumDetailBottomView *bottomView;
@end
@implementation ForumItemDetailViewController
......@@ -118,6 +127,10 @@
[self.forumDetailTableView registerClass:[ForumDetailPhotoTableViewCell class] forCellReuseIdentifier:@"ForumDetailPhotoTableViewCell"];
[self setUpHeaderView];
self.forumDetailTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.commentInputTextFieldView.inputAccessoryView = self.bottomView.toolView;
}
#pragma mark - WKWebView/photoManager
......@@ -283,6 +296,8 @@
#pragma mark - 确认回复
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
[[UIApplication sharedApplication].keyWindow endEditing:YES];
if ([[self class] isBlankString:textField.text]) {
[XBLoadingView showHUDViewWithText:@"评论内容不能为空"];
}else {
......@@ -291,18 +306,87 @@
return YES;
}
#pragma mark - 上传图片附件
- (void)uploadAttachments:(void(^)(NSArray *OSSKeys))finish
{
NSMutableArray *OSSKeyArray = [NSMutableArray array];
for (int i=0; i<self.bottomView.toolView.arrSelectedPhotos.count; i++) {
[OSSKeyArray addObject:[OSSHelper getOSSObjectKeyWithtype:@"png" index:i]];
}
XBLoadingView *loadView = [XBLoadingView showHUDViewProgressLabel:[NSString stringWithFormat:@"图片上传中:1/%ld",self.bottomView.toolView.arrSelectedPhotos.count]];
static NSInteger number = 0;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
for (int i=0;i<self.bottomView.toolView.arrSelectedPhotos.count;i++) {
UIImage *image = self.bottomView.toolView.arrSelectedPhotos[i];
NSString *ossKey = OSSKeyArray[i];
NSData *data = UIImagePNGRepresentation(image);
[OSSHelper uploadImageObjectWithKey:ossKey data:data type:OSSHelperOperationTypeSynchronous progress:^(int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend) {
CGFloat totalBytesSentFloat = totalBytesSent;
CGFloat totalBytesExpectedToSendFloat = totalBytesExpectedToSend;
CGFloat progress = totalBytesSentFloat / totalBytesExpectedToSendFloat;
NSLog(@"-->进度%f", progress);
loadView.progress = progress;
} success:^id(OSSTask *task) {
number ++;
loadView.labelText = [NSString stringWithFormat:@"图片上传中:%ld/%ld",number,self.self.bottomView.toolView.arrSelectedPhotos.count];
if (number == self.bottomView.toolView.arrSelectedPhotos.count) {
number = 0;
dispatch_async(dispatch_get_main_queue(), ^{
[loadView hide:YES];
[XBLoadingView showHUDViewWithSuccessText:@"图片上传成功" completeBlock:^{
finish(OSSKeyArray);
}];
});
}
return nil;
} error:^(NSError *error) {
[XBLoadingView hideHUDViewWithDefault];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
});
}
#pragma mark - 回复帖子
- (void)replyPostRequest
{
[self.view endEditing:YES];
TOForumReplyEntity *reply = [[TOForumReplyEntity alloc] init];
reply.topicId = self.topicDetail.fid;
reply.replyContent = self.commentInputTextFieldView.text;
reply.replyerName = [Shoppersmanager manager].shoppers.employee.userName;
reply.replyerRealName = [Shoppersmanager manager].shoppers.employee.realName;
reply.replyerPosition = [Shoppersmanager manager].shoppers.employee.positionsName;
reply.replyTime = [[self class] getTimeby:0];
reply.replyerId = [Shoppersmanager manager].shoppers.employee.fid;
WS(weakSelf);
[self uploadAttachments:^(NSArray *OSSKeys) {
NSLog(@"%@", OSSKeys);
TOForumReplyEntity *reply = [[TOForumReplyEntity alloc] init];
reply.topicId = self.topicDetail.fid;
reply.replyContent = self.commentInputTextFieldView.text;
reply.replyerName = [Shoppersmanager manager].shoppers.employee.userName;
reply.replyerRealName = [Shoppersmanager manager].shoppers.employee.realName;
reply.replyerPosition = [Shoppersmanager manager].shoppers.employee.positionsName;
reply.replyTime = [[self class] getTimeby:0];
reply.replyerId = [Shoppersmanager manager].shoppers.employee.fid;
NSMutableArray *attachments = [NSMutableArray array];
NSString *entityId = [OSSHelper getOSSObjectKey];
reply.attachmentId = entityId;
for (NSString *ossKey in OSSKeys) {
TOAttachmentEntity *entity = [[TOAttachmentEntity alloc] init];
entity.entityType = @"forumReply";
entity.entityId = entityId;
entity.fileUrl = [OSSHelper getCompleteImageURLWithOSSkey:ossKey];
entity.fileName = ossKey;
[attachments addObject:entity];
}
reply.attachments = (NSArray<TOAttachmentEntity>*)attachments;
[weakSelf httpSubmit:reply complete:nil];
}];
}
- (void)httpSubmit:(TOForumReplyEntity *)reply complete:(void (^)(void))complete {
[XBLoadingView showHUDViewWithDefault];
WS(weakSelf);
[HTTP networkRequestWithURL:SERVERREQUESTURL(REPLYPOST) withRequestType:ZERO withParameter:reply withReturnValueBlock:^(id returnValue) {
......
//
// ForumDetailBottomPictureCell.h
// Lighting
//
// Created by Javen on 2017/4/17.
// Copyright © 2017年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ForumDetailBottomPictureCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@property (copy, nonatomic) void (^blockDelete)(void);
@end
//
// ForumDetailBottomPictureCell.m
// Lighting
//
// Created by Javen on 2017/4/17.
// Copyright © 2017年 上海勾芒科技有限公司. All rights reserved.
//
#import "ForumDetailBottomPictureCell.h"
@implementation ForumDetailBottomPictureCell
- (IBAction)actionDelete:(UIButton *)sender {
if (self.blockDelete) {
self.blockDelete();
}
}
@end
//
// ForumDetailBottomView.h
// Lighting
//
// Created by Javen on 2017/4/17.
// Copyright © 2017年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "ZJKeyBoardAccessoryView.h"
@interface ForumDetailBottomView : UIView<UICollectionViewDelegate, UICollectionViewDataSource>
@property (weak, nonatomic) IBOutlet UICollectionView *collectionView;
@property (weak, nonatomic) IBOutlet UICollectionViewFlowLayout *layout;
/**
输入框toolbar
*/
@property (strong, nonatomic) ZJKeyBoardAccessoryView *toolView;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *layoutHeight;
@end
//
// ForumDetailBottomView.m
// Lighting
//
// Created by Javen on 2017/4/17.
// Copyright © 2017年 上海勾芒科技有限公司. All rights reserved.
//
#import "ForumDetailBottomView.h"
#import "ForumDetailBottomPictureCell.h"
@implementation ForumDetailBottomView
- (void)awakeFromNib {
[super awakeFromNib];
self.collectionView.delegate = self;
self.collectionView.dataSource = self;
self.layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
self.layout.itemSize = CGSizeMake(64, 64);
self.layout.sectionInset = UIEdgeInsetsMake(0, 30, 0, 30);
self.toolView = [[ZJKeyBoardAccessoryView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 44)];
self.layoutHeight.constant = 50;
//结束选择照片 (删除照片时这里也会回调)
WS(weakSelf);
self.toolView.blockFinishSelected = ^{
[weakSelf.collectionView reloadData];
if (weakSelf.toolView.arrSelectedPhotos.count > 0) {
weakSelf.layoutHeight.constant = 114;
}else{
weakSelf.layoutHeight.constant = 50;
}
};
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.toolView.arrSelectedPhotos.count;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
ForumDetailBottomPictureCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"ForumDetailBottomPictureCell" forIndexPath:indexPath];
UIImage *image = self.toolView.arrSelectedPhotos[indexPath.row];
cell.imageView.image = image;
WS(weakSelf);
cell.blockDelete = ^{
ShowAlertView(weakSelf.viewController, nil, @"确认删除", @"取消", @"确认", UIAlertControllerStyleAlert, ^{
NSLog(@"删除");
[weakSelf.toolView deletePhotoWithIndex:indexPath.row];
},
nil);
};
return cell;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
......@@ -27,6 +27,7 @@
CGFloat interval = 30;
for (int i=0; i<itemArray.count; i++) {
UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
// button.imageView
button.tag = i;
button.tintColor = [UIColor whiteColor];
[button setBackgroundImage:TCImage(itemArray[i]) forState:UIControlStateNormal];
......
//
// ZJKeyBoardAccessoryView.h
// Lighting
//
// Created by Javen on 2017/4/17.
// Copyright © 2017年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ZJKeyBoardAccessoryView : UIView
@property (strong, nonatomic) NSMutableArray *arrSelectedAssets;
@property (strong, nonatomic) NSMutableArray *arrSelectedPhotos;
@property (nonatomic, copy) void (^blockFinishSelected)(void);
- (void)deletePhotoWithIndex:(NSInteger)index;
@end
//
// ZJKeyBoardAccessoryView.m
// Lighting
//
// Created by Javen on 2017/4/17.
// Copyright © 2017年 上海勾芒科技有限公司. All rights reserved.
//
#import "ZJKeyBoardAccessoryView.h"
#import "STEmojiKeyboard.h"
#import <AssetsLibrary/AssetsLibrary.h>
#import <Photos/Photos.h>
#import "MWPhotoBrowser.h"
/**
扩展项
- Camera: 相机
- PhotoAlbum: 相册
- Emoji: 表情
*/
typedef NS_ENUM(NSInteger, ItemIndex) {
Camera = 0,
PhotoAlbum,
Emoji,
};
@interface ZJKeyBoardAccessoryView () <UIImagePickerControllerDelegate, UINavigationControllerDelegate, MWPhotoBrowserDelegate>
@property (strong, nonatomic) NSMutableArray *allPhotoArray;
/**
<#Description#>
*/
@property (strong, nonatomic) NSMutableArray *mwPhotoArray;
/**
缩略图
*/
@property (strong, nonatomic) NSMutableArray *thumbsArray;
@end
@implementation ZJKeyBoardAccessoryView
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
self.backgroundColor = [UIColor whiteColor];
[self uiConfigAction];
}
return self;
}
#pragma mark - UI
- (void)uiConfigAction {
NSArray *itemArray = @[ @"camera", @"album" ];
CGFloat size = 25;
CGFloat interval = 30;
for (int i = 0; i < itemArray.count; i++) {
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
// button.imageView
button.tag = i;
// button.tintColor = [UIColor whiteColor];
[button setImage:TCImage(itemArray[i]) forState:UIControlStateNormal];
button.frame = CGRectMake(i * size + i * interval + 50, (self.height - size) / 2, size, size);
[button addTarget:self action:@selector(extensionButtonClick:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:button];
}
}
- (void)extensionButtonClick:(UIButton *)btn {
switch (btn.tag) {
case Camera: {
[self showCameraAction];
} break;
case PhotoAlbum: {
[self selectAlbumImage];
} break;
default:
break;
}
}
#pragma mark - 拍照选择照片
- (void)showCameraAction {
if ([BaseViewController determineCameraPermissions]) {
UIImagePickerController *camera = [[UIImagePickerController alloc] init];
camera.delegate = self;
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
[camera setSourceType:UIImagePickerControllerSourceTypeCamera];
camera.allowsEditing = YES;
[self.viewController presentViewController:camera animated:YES completion:nil];
} else {
[XBLoadingView showHUDViewWithText:@"相机无法使用"];
}
} else {
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"提示" message:@"请在iPad的“设置-隐私-相机”选项中,允许欧立方访问你的相机" preferredStyle:UIAlertControllerStyleAlert];
[alertVC addAction:[UIAlertAction actionWithTitle:@"知道了" style:UIAlertActionStyleCancel handler:nil]];
[self.viewController presentViewController:alertVC animated:YES completion:nil];
}
}
#pragma mark - <UIImagePickerControllerDelegate>
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *, id> *)info {
// [self.navigationController dismissViewControllerAnimated:YES completion:nil];
UIImage *headImage = [info objectForKey:UIImagePickerControllerOriginalImage];
// [self.selectedImageArray addObject:headImage];
// [self.publishTableView reloadData];
}
#pragma mark - 相册选择照片
#pragma mark - MWPhotoBrowserDelegate
- (NSUInteger)numberOfPhotosInPhotoBrowser:(MWPhotoBrowser *)photoBrowser {
return self.mwPhotoArray.count;
}
- (id<MWPhoto>)photoBrowser:(MWPhotoBrowser *)photoBrowser photoAtIndex:(NSUInteger)index {
if (index < self.mwPhotoArray.count)
return [self.mwPhotoArray objectAtIndex:index];
return nil;
}
- (id<MWPhoto>)photoBrowser:(MWPhotoBrowser *)photoBrowser thumbPhotoAtIndex:(NSUInteger)index {
if (index < self.thumbsArray.count)
return [self.thumbsArray objectAtIndex:index];
return nil;
}
- (BOOL)photoBrowser:(MWPhotoBrowser *)photoBrowser isPhotoSelectedAtIndex:(NSUInteger)index {
PHAsset *currentPhoto = self.allPhotoArray[index];
return [self.arrSelectedAssets containsObject:currentPhoto];
}
- (void)photoBrowser:(MWPhotoBrowser *)photoBrowser photoAtIndex:(NSUInteger)index selectedChanged:(BOOL)selected {
PHAsset *currentPhoto = self.allPhotoArray[index];
if (selected) {
[self.arrSelectedAssets addObject:currentPhoto];
} else {
[self.arrSelectedAssets removeObject:currentPhoto];
}
}
- (void)photoBrowserDidFinishModalPresentation:(MWPhotoBrowser *)photoBrowser {
if (self.arrSelectedAssets.count > 3) {
[XBLoadingView showHUDViewWithText:@"图片最多选择3张"];
return;
}
PHImageManager *imageManager = [PHImageManager defaultManager];
PHImageRequestOptions *options = [PHImageRequestOptions new];
options.networkAccessAllowed = YES;
options.resizeMode = PHImageRequestOptionsResizeModeFast;
options.deliveryMode = PHImageRequestOptionsDeliveryModeHighQualityFormat;
options.synchronous = YES;
WS(weakSelf);
[self.arrSelectedPhotos removeAllObjects];
for (PHAsset *asset in self.arrSelectedAssets) {
[imageManager requestImageForAsset:asset
targetSize:CGSizeMake(ScreenWidth, ScreenHeight)
contentMode:PHImageContentModeAspectFit
options:options
resultHandler:^(UIImage *result, NSDictionary *info){
[weakSelf.arrSelectedPhotos addObject:result];
}];
}
if (self.blockFinishSelected) {
self.blockFinishSelected();
}
[photoBrowser dismissViewControllerAnimated:YES
completion:nil];
}
- (void)selectAlbumImage {
MWPhotoBrowser *browser = [[MWPhotoBrowser alloc] initWithDelegate:self];
browser.displayActionButton = YES;
browser.displayNavArrows = YES;
browser.displaySelectionButtons = YES;
browser.alwaysShowControls = YES;
browser.zoomPhotosToFill = YES;
browser.enableGrid = YES;
browser.startOnGrid = YES;
browser.enableSwipeToDismiss = YES;
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:browser];
[self.viewController.navigationController presentViewController:nav animated:YES completion:nil];
}
- (void)deletePhotoWithIndex:(NSInteger)index {
[self.arrSelectedAssets removeObjectAtIndex:index];
[self.arrSelectedPhotos removeObjectAtIndex:index];
if (self.blockFinishSelected) {
self.blockFinishSelected();
}
}
- (NSMutableArray *)mwPhotoArray {
if (!_mwPhotoArray) {
_mwPhotoArray = [NSMutableArray array];
_thumbsArray = [NSMutableArray array];
_allPhotoArray = [NSMutableArray array];
PHFetchOptions *options = [PHFetchOptions new];
options.sortDescriptors = @[ [NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:NO] ];
PHFetchResult *fetchResults = [PHAsset fetchAssetsWithOptions:options];
UIScreen *screen = [UIScreen mainScreen];
CGFloat scale = screen.scale;
// Sizing is very rough... more thought required in a real implementation
CGFloat imageSize = MAX(screen.bounds.size.width, screen.bounds.size.height) * 1.5;
CGSize thumbTargetSize = CGSizeMake(imageSize / 3.0 * scale, imageSize / 3.0 * scale);
CGSize imageTargetSize = CGSizeMake(imageSize * scale, imageSize * scale);
[fetchResults enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
[_allPhotoArray addObject:obj];
[_mwPhotoArray addObject:[MWPhoto photoWithAsset:obj targetSize:imageTargetSize]];
[_thumbsArray addObject:[MWPhoto photoWithAsset:obj targetSize:thumbTargetSize]];
}];
}
return _mwPhotoArray;
}
- (NSMutableArray *)arrSelectedAssets {
if (!_arrSelectedAssets) {
_arrSelectedAssets = [NSMutableArray array];
}
return _arrSelectedAssets;
}
- (NSMutableArray *)arrSelectedPhotos {
if (!_arrSelectedPhotos) {
_arrSelectedPhotos = [NSMutableArray array];
}
return _arrSelectedPhotos;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
......@@ -203,6 +203,7 @@
[weakSelf videoPlayFinish:studyList withIndexPath:indexPath];
}];
}];
[self presentViewController:pptVc animated:YES completion:nil];
}
}
......@@ -229,21 +230,11 @@
}];
}
#pragma mark - 学习完成,告诉服务器学习完成
- (void)httpStudyCompleteTaskId:(NSString *)taskId {
NSString *url = [NSString stringWithFormat:@"/study/finishStudy/%@/%@", taskId, [Shoppersmanager manager].shoppers.employee.fid];
[HTTP networkRequestWithURL:SERVERREQUESTURL(url) withRequestType:(GET) withParameter:nil withReturnValueBlock:^(id returnValue) {
NSLog(@"%@", returnValue);
} withFailureBlock:^(NSError *error) {
}];
}
#pragma mark - 视频播放完成
- (void)videoPlayFinish:(CustomStudyEntity *)studyEntity withIndexPath:(NSIndexPath *)indexPath
{
[self httpStudyCompleteTaskId:studyEntity.fid];
WS(weakSelf);
[self studyFinishGetIntegral:^(NSString *integral) {
LearningCompleteViewController *assessmentVc = [[[weakSelf class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"LearningCompleteViewController"];
......
......@@ -335,6 +335,9 @@
29F726011CE1D05D0072FE0E /* ScreeningCollectionReusableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 29F726001CE1D05D0072FE0E /* ScreeningCollectionReusableView.m */; };
29F726041CE1E96E0072FE0E /* ScreeningSecondCollectionReusableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 29F726031CE1E96E0072FE0E /* ScreeningSecondCollectionReusableView.m */; };
458754197D16754238F76D64 /* libPods-Lighting.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 776B804E9EBF4148093B44DF /* libPods-Lighting.a */; };
8F0FD1A11EA48EC500D38035 /* ForumDetailBottomView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F0FD1A01EA48EC500D38035 /* ForumDetailBottomView.m */; };
8F0FD1A41EA494EA00D38035 /* ForumDetailBottomPictureCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F0FD1A31EA494EA00D38035 /* ForumDetailBottomPictureCell.m */; };
8F0FD1A71EA4A8BF00D38035 /* ZJKeyBoardAccessoryView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F0FD1A61EA4A8BF00D38035 /* ZJKeyBoardAccessoryView.m */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
......@@ -976,6 +979,12 @@
29F726031CE1E96E0072FE0E /* ScreeningSecondCollectionReusableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ScreeningSecondCollectionReusableView.m; sourceTree = "<group>"; };
76F03CC259F648C692EA812D /* Pods-Lighting.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Lighting.release.xcconfig"; path = "Pods/Target Support Files/Pods-Lighting/Pods-Lighting.release.xcconfig"; sourceTree = "<group>"; };
776B804E9EBF4148093B44DF /* libPods-Lighting.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Lighting.a"; sourceTree = BUILT_PRODUCTS_DIR; };
8F0FD19F1EA48EC500D38035 /* ForumDetailBottomView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ForumDetailBottomView.h; sourceTree = "<group>"; };
8F0FD1A01EA48EC500D38035 /* ForumDetailBottomView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ForumDetailBottomView.m; sourceTree = "<group>"; };
8F0FD1A21EA494EA00D38035 /* ForumDetailBottomPictureCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ForumDetailBottomPictureCell.h; sourceTree = "<group>"; };
8F0FD1A31EA494EA00D38035 /* ForumDetailBottomPictureCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ForumDetailBottomPictureCell.m; sourceTree = "<group>"; };
8F0FD1A51EA4A8BF00D38035 /* ZJKeyBoardAccessoryView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZJKeyBoardAccessoryView.h; sourceTree = "<group>"; };
8F0FD1A61EA4A8BF00D38035 /* ZJKeyBoardAccessoryView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZJKeyBoardAccessoryView.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -2160,6 +2169,8 @@
29ACDAE51DF9696E003A0634 /* CustomImageBackView.m */,
29B78C101DFA8BD500C7C6D8 /* KeyBoardAccessoryView.h */,
29B78C111DFA8BD500C7C6D8 /* KeyBoardAccessoryView.m */,
8F0FD1A51EA4A8BF00D38035 /* ZJKeyBoardAccessoryView.h */,
8F0FD1A61EA4A8BF00D38035 /* ZJKeyBoardAccessoryView.m */,
291D11971E790DFA001E081E /* CalibrationCollectionViewCell.h */,
291D11981E790DFA001E081E /* CalibrationCollectionViewCell.m */,
291D119A1E790E16001E081E /* CalibrationDetailCollectionCell.h */,
......@@ -2170,6 +2181,10 @@
291D11A11E7923FF001E081E /* TriangleIndicatorView.m */,
299E45C51E8D2C860071A4CF /* ForumDetailPhotoTableViewCell.h */,
299E45C61E8D2C860071A4CF /* ForumDetailPhotoTableViewCell.m */,
8F0FD19F1EA48EC500D38035 /* ForumDetailBottomView.h */,
8F0FD1A01EA48EC500D38035 /* ForumDetailBottomView.m */,
8F0FD1A21EA494EA00D38035 /* ForumDetailBottomPictureCell.h */,
8F0FD1A31EA494EA00D38035 /* ForumDetailBottomPictureCell.m */,
);
path = Views;
sourceTree = "<group>";
......@@ -3151,6 +3166,7 @@
29E384D11CE9C65700888199 /* SearchViewController.m in Sources */,
29AB91FF1E553C16003A3A08 /* AnnouncementListTableViewCell.m in Sources */,
2928F8421CD0ABAC0036D761 /* ShoppingViewController.m in Sources */,
8F0FD1A71EA4A8BF00D38035 /* ZJKeyBoardAccessoryView.m in Sources */,
29AB920C1E5542CD003A3A08 /* MessageTableViewCell.m in Sources */,
29698D611CE2C11500D72CE7 /* SettlementViewController.m in Sources */,
29498C5D1D053B2C004FA79B /* ShoppingBagViewController.m in Sources */,
......@@ -3200,6 +3216,7 @@
291D118D1E790B0B001E081E /* DiscussMainViewController.m in Sources */,
2942F8A61CDD80C2005B377E /* authenticateView.m in Sources */,
29ACDAE31DF966EF003A0634 /* ForumItemListViewController.m in Sources */,
8F0FD1A11EA48EC500D38035 /* ForumDetailBottomView.m in Sources */,
2940AE861DE7FCDB001164B0 /* VideoListViewController.m in Sources */,
291D6A581CFFD45F007891AE /* SceneSectionHeaderView.m in Sources */,
29CC51F51E8A011E009FBB6A /* BindingSuccessViewController.m in Sources */,
......@@ -3275,6 +3292,7 @@
295DEAA71DB756DA006ED4A6 /* CardCollectionViewCell.m in Sources */,
291D6A6B1D000A2A007891AE /* ProductScreeningCollectionViewCell.m in Sources */,
29CC51EC1E8A011E009FBB6A /* PaymentWithdrawalMainViewController.m in Sources */,
8F0FD1A41EA494EA00D38035 /* ForumDetailBottomPictureCell.m in Sources */,
297BA2C81DE94D3300474F79 /* VIMediaDownloader.m in Sources */,
299876421CD99E4000C90D0A /* OrderdetailsViewController.m in Sources */,
29EC331A1CE023D5005F0C13 /* ChangePasswordViewController.m in Sources */,
......
This diff is collapsed.
{
"images" : [
{
"idiom" : "universal",
"filename" : "img_delete_icon.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "img_delete_icon@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "img_delete_icon@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -15,7 +15,7 @@
<key>CFBundleName</key>
<string>欧立方</string>
<key>CFBundleShortVersionString</key>
<string>2.1.0</string>
<string>2.1.1</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
......@@ -48,7 +48,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string></string>
<string>2.1.1</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>wechat</string>
......
......@@ -99,6 +99,10 @@ typedef NS_ENUM(NSInteger,COMMENT_PRAISE) {
#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://gomoredev:8082/opple-web/app%@",URL]
//外网http://debenson.picp.io/opple-web/
/**
* 局域网开发地址
*/
//#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://192.168.199.198:8080/opple-web/app%@",URL]
/**
* 服务器测试地址
......
......@@ -5757,8 +5757,6 @@ extern NSString * const GRADEMETHOD_MANUL;
*
*/
@property (nonatomic, copy) NSString *replyTime;
@property (nonatomic,copy) NSString *replyerPicture;
/**
* 方法: 取得回复内容
*
......@@ -5795,6 +5793,36 @@ extern NSString * const GRADEMETHOD_MANUL;
*
*/
@property (nonatomic, copy) NSString *replyerPosition;
/**
* (no documentation provided)
*
*
*/
@property (nonatomic, assign) NSInteger top;
/**
* (no documentation provided)
*
*
*/
@property (nonatomic, copy) NSString *attachmentId;
/**
* (no documentation provided)
* @see TOAttachmentEntity
*
*/
@property (nonatomic, strong) NSArray<TOAttachmentEntity> *attachments;
/**
* (no documentation provided)
*
*
*/
@property (nonatomic, copy) NSString *bestName;
/**
* 回复人头像
*
*
*/
@property (nonatomic, copy) NSString *replyerPicture;
@end /* interface TOForumReplyEntity */
......
......@@ -1996,6 +1996,11 @@ NSString * const GRADEMETHOD_MANUL = @"manul";
@synthesize replyerName;
@synthesize replyerRealName;
@synthesize replyerPosition;
@synthesize top;
@synthesize attachmentId;
@synthesize attachments;
@synthesize bestName;
@synthesize replyerPicture;
+(BOOL)propertyIsOptional:(NSString*)propertyName
{
......
......@@ -195,7 +195,7 @@
CGFloat distanceFromBottom = scrollView.contentSize.height - contentYoffset;
WS(weakSelf);
if (distanceFromBottom <= height && self.type == Study) {
[self httpStudyCompleteTaskId:self.studyId];
ShowDefaultAlertView(self, nil, @"学习完成,是否开始考核?", UIAlertControllerStyleAlert, ^{
if (weakSelf.scrollViewEndBottomBlock) {
weakSelf.scrollViewEndBottomBlock(weakSelf.indexPath);
......@@ -204,15 +204,6 @@
}
}
#pragma mark - 学习完成,告诉服务器学习完成
- (void)httpStudyCompleteTaskId:(NSString *)taskId {
NSString *url = [NSString stringWithFormat:@"/study/finishStudy/%@/%@", taskId, [Shoppersmanager manager].shoppers.employee.fid];
[HTTP networkRequestWithURL:SERVERREQUESTURL(url) withRequestType:(GET) withParameter:nil withReturnValueBlock:^(id returnValue) {
NSLog(@"%@", returnValue);
} withFailureBlock:^(NSError *error) {
}];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment