Commit 81fff7a1 authored by 曹云霄's avatar 曹云霄

修改项说明:学习详情页开发,自定义视频播放器

parent 16b9503b
File added
......@@ -188,13 +188,9 @@
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:@"无网络"];
} WithFailureBlock:^(id error) {
[weakSelf endRefreshingForTableView:weakSelf.allCustomerTableview];
[weakSelf RemoveMBProgressHUDLoding];
}];
}
......
......@@ -193,11 +193,9 @@
[weakSelf.announcementTableView reloadData];
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf endRefreshingForTableView:weakSelf.announcementTableView];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf endRefreshingForTableView:weakSelf.announcementTableView];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
......
......@@ -114,10 +114,8 @@
[weakSelf.announcementDetailsTableView reloadData];
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......
......@@ -60,7 +60,6 @@
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
[self RemoveMBProgressHUDLoding];
[self ErrorMBProgressView:@"加载失败"];
}
......
......@@ -139,10 +139,8 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......
......@@ -118,11 +118,9 @@
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf endRefreshingForTableView:weakSelf.beenUseCardCollectionView];
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.beenUseCardCollectionView];
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......@@ -141,10 +139,8 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......
......@@ -136,11 +136,9 @@
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf endRefreshingForTableView:weakSelf.dontUseCardCollectionView];
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.dontUseCardCollectionView];
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......@@ -280,10 +278,8 @@
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......
......@@ -99,10 +99,8 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......
......@@ -92,7 +92,6 @@
[weakSelf.delegate cancelButtonClick];
}
}else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
......@@ -101,14 +100,10 @@
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:@"无网络"];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(id error) {
NSLog(@"%@",error);
}];
}
......
......@@ -111,10 +111,8 @@
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......
......@@ -207,12 +207,8 @@
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf promptCustomerWithString:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf endRefreshingForTableView:weakSelf.informationTableview];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
......@@ -466,10 +462,8 @@
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......@@ -632,12 +626,8 @@
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf promptCustomerWithString:@"网络连接已断开"];
} WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding];
}];
}
......
......@@ -175,12 +175,9 @@
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:@"无网络"];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(id error) {
[weakSelf endRefreshingForTableView:weakSelf.customerOrderTableView];
[weakSelf RemoveMBProgressHUDLoding];
}];
}
......@@ -352,10 +349,8 @@
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[self RemoveMBProgressHUDLoding];
[self ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}]];
......
......@@ -116,11 +116,9 @@
[weakSelf.integralDetailsTableView reloadData];
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf endRefreshingForTableView:weakSelf.integralDetailsTableView];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf endRefreshingForTableView:weakSelf.integralDetailsTableView];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
......@@ -150,11 +148,9 @@
[weakSelf.integralDetailsTableView reloadData];
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf endRefreshingForTableView:weakSelf.integralDetailsTableView];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf endRefreshingForTableView:weakSelf.integralDetailsTableView];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
......
//
// ForumItemListViewController.h
// Lighting
//
// Created by 曹云霄 on 2016/11/25.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ForumItemListViewController : UITableViewController
@end
//
// ForumItemListViewController.m
// Lighting
//
// Created by 曹云霄 on 2016/11/25.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "ForumItemListViewController.h"
@interface ForumItemListViewController ()
@end
@implementation ForumItemListViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
#warning Incomplete implementation, return the number of sections
return 0;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
#warning Incomplete implementation, return the number of rows
return 0;
}
/*
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath];
// Configure the cell...
return cell;
}
*/
/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the specified item to be editable.
return YES;
}
*/
/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
} else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/
/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/
/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the item to be re-orderable.
return YES;
}
*/
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
//
// ForumTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 2016/11/25.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ForumTableViewCell : UITableViewCell
/**
讨论项图片
*/
@property (weak, nonatomic) IBOutlet UIImageView *forumImageView;
/**
讨论项标题
*/
@property (weak, nonatomic) IBOutlet UILabel *forumTitleLabel;
/**
讨论项说明
*/
@property (weak, nonatomic) IBOutlet UILabel *forumDetailTitleLabel;
@end
//
// ForumTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 2016/11/25.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "ForumTableViewCell.h"
@implementation ForumTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
......@@ -10,4 +10,7 @@
@interface ForumViewController : BaseViewController
@property (weak, nonatomic) IBOutlet UITableView *forumTableView;
@end
......@@ -7,8 +7,9 @@
//
#import "ForumViewController.h"
#import "ForumTableViewCell.h"
@interface ForumViewController ()
@interface ForumViewController ()<UITableViewDelegate,UITableViewDataSource>
@end
......@@ -16,22 +17,54 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self setUpForumTableView];
[self getForumAllTypeAction];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
#pragma mark - UITableView
- (void)setUpForumTableView
{
self.forumTableView.tableFooterView = [UIView new];
self.forumTableView.rowHeight = 90;
}
/*
#pragma mark - Navigation
#pragma mark - 获取论坛项Type
- (void)getForumAllTypeAction
{
WS(weakSelf);
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(FORUMTYPS) WithCallClass:weakSelf WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
NSLog(@"%@",returnValue);
if ([returnValue[@"code"] isEqualToNumber:@0]) {
}else{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
#pragma mark - <UITableViewDelegate,UITableViewDataSource>
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
ForumTableViewCell *forumCell = [tableView dequeueReusableCellWithIdentifier:@"ForumTableViewCell" forIndexPath:indexPath];
return forumCell;
}
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 10;
}
*/
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
}
@end
......@@ -41,7 +41,6 @@
[weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
RsScoreDetails *integralDatas = [[RsScoreDetails alloc]initWithDictionary:returnValue[@"data"] error:nil];
[weakSelf setUpIntegral:integralDatas];
......@@ -50,10 +49,8 @@
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......@@ -69,7 +66,7 @@
#pragma mark - 综合讨论
- (void)comprehensiveDiscussionViewClickAction:(UITapGestureRecognizer *)sender
{
ForumViewController *forum = [[[self class] getMainStoryboardClass]instantiateViewControllerWithIdentifier:@"ForumViewController"];
ForumViewController *forum = [[[self class] getLearningCenterStoryboardClass]instantiateViewControllerWithIdentifier:@"ForumViewController"];
[self.navigationController pushViewController:forum animated:YES];
}
......
//
// OnlineLearningDetailViewController.h
// Lighting
//
// Created by 曹云霄 on 2016/11/25.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface OnlineLearningDetailViewController : BaseViewController
@end
//
// OnlineLearningDetailViewController.m
// Lighting
//
// Created by 曹云霄 on 2016/11/25.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "OnlineLearningDetailViewController.h"
#import "VideoHelperViewController.h"
#import "VideoListViewController.h"
#import "VideoDetailViewController.h"
@interface OnlineLearningDetailViewController ()
@end
@implementation OnlineLearningDetailViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self addChildViewController];
}
#pragma mark -
- (void)addChildViewController
{
//播放窗口
VideoHelperViewController *videoWindow = [[[self class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"VideoHelperViewController"];
videoWindow.videoUrl = @"http://gomoretech1.oss-cn-shanghai.aliyuncs.com/211534962/studyingSkills/coffee.mp4";
videoWindow.view.frame = CGRectMake(0, NavigationHeight, ScreenWidth*2/3, ScreenHeight/2);
[self addChildViewController:videoWindow];
[self.view addSubview:videoWindow.view];
//播放列表
VideoListViewController *playList = [[[self class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"VideoListViewController"];
playList.view.frame = CGRectMake(ScreenWidth*2/3 + 5, NavigationHeight, ScreenWidth/3-5, ScreenHeight-64);
[self addChildViewController:playList];
[self.view addSubview:playList.view];
//播放简介
VideoDetailViewController *playDetail = [[[self class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"VideoDetailViewController"];
playDetail.view.frame = CGRectMake(0, ScreenHeight/2+NavigationHeight, ScreenWidth*2/3, ScreenHeight/2-NavigationHeight);
[self addChildViewController:playDetail];
[self.view addSubview:playDetail.view];
__block VideoHelperViewController *weakVideWindow = videoWindow;
//全屏
WS(weakSelf);
[videoWindow setZoomButtonClickBlock:^(BOOL boolValue) {
if (boolValue) {
[weakSelf.view.window addSubview:weakVideWindow.view];
[UIView animateWithDuration:0.2 animations:^{
weakVideWindow.view.frame = [UIScreen mainScreen].bounds;
weakVideWindow.playerLayer.frame = [UIScreen mainScreen].bounds;
}];
}else{
[weakSelf.view insertSubview:weakVideWindow.view atIndex:0];
[UIView animateWithDuration:0.2 animations:^{
weakVideWindow.view.frame = CGRectMake(0, NavigationHeight, ScreenWidth*2/3, ScreenHeight/2);
weakVideWindow.playerLayer.frame = CGRectMake(0, 0, ScreenWidth*2/3, ScreenHeight/2);
}completion:nil];
}
}];
}
@end
......@@ -10,4 +10,9 @@
@interface OnlineLearningTableViewCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UIImageView *studyItemImageView;
@property (weak, nonatomic) IBOutlet UILabel *studyItemTitleLabel;
@end
......@@ -8,7 +8,7 @@
#import "OnlineLearningViewController.h"
#import "OnlineLearningTableViewCell.h"
#import "OnlineLearningDetailViewController.h"
@interface OnlineLearningViewController ()<UICollectionViewDelegate,UICollectionViewDataSource>
......@@ -44,6 +44,7 @@
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(STUDYTYPES) WithCallClass:weakSelf WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weakSelf.studyTypeArray addObjectsFromArray:returnValue[@"data"]];
}else {
......@@ -52,10 +53,8 @@
[weakSelf.onlineLearningCollectionView reloadData];
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......@@ -63,15 +62,21 @@
#pragma mark - <UICollectionViewDelegate,UICollectionViewDataSource>
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
return self.studyTypeArray.count;
return self.studyTypeArray.count+1;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
OnlineLearningTableViewCell *learningCell = [collectionView dequeueReusableCellWithReuseIdentifier:@"OnlineLearningTableViewCell" forIndexPath:indexPath];
// learningCell.studyItemTitleLabel.text = self.studyTypeArray[indexPath.row];
return learningCell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
OnlineLearningDetailViewController *studyDetail = [[[self class] getLearningCenterStoryboardClass]instantiateViewControllerWithIdentifier:@"OnlineLearningDetailViewController"];
[self.navigationController pushViewController:studyDetail animated:YES];
}
#pragma mark - lazy
......
//
// PPTListItemTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 2016/11/25.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface PPTListItemTableViewCell : UITableViewCell
/**
PPT状态
*/
@property (weak, nonatomic) IBOutlet UIButton *pptButton;
/**
学习项简介
*/
@property (weak, nonatomic) IBOutlet UILabel *studyItemTitleLabel;
/**
PPT播放进度
*/
@property (weak, nonatomic) IBOutlet PNCircleChart *seekbarView;
/**
学习时间
*/
@property (weak, nonatomic) IBOutlet UILabel *studyItemLabel;
@end
//
// PPTListItemTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 2016/11/25.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "PPTListItemTableViewCell.h"
@implementation PPTListItemTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// VideoDetailIntroTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 2016/11/25.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface VideoDetailIntroTableViewCell : UITableViewCell
/**
介绍项标题
*/
@property (weak, nonatomic) IBOutlet UILabel *studyIntroTitleLabel;
/**
简介
*/
@property (weak, nonatomic) IBOutlet UILabel *studyIntroDetailTitleLabel;
@end
//
// VideoDetailIntroTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 2016/11/25.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "VideoDetailIntroTableViewCell.h"
@implementation VideoDetailIntroTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// VideoDetailViewController.h
// Lighting
//
// Created by 曹云霄 on 2016/11/25.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
/**
学习项介绍
- StudyItemIntroCell: 课时简介
- LecturerIntroCell: 讲师简介
- ContraposePersonCell: 针对人员
*/
typedef NS_ENUM(NSInteger,CellType){
StudyItemIntroCell = 0,
LecturerIntroCell,
ContraposePersonCell
};
@interface VideoDetailViewController : BaseViewController
/**
学习简介详情
*/
@property (weak, nonatomic) IBOutlet UITableView *studyItemDetailsTableView;
@end
//
// VideoDetailViewController.m
// Lighting
//
// Created by 曹云霄 on 2016/11/25.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "VideoDetailViewController.h"
#import "VideoDetailIntroTableViewCell.h"
#import "VideoLecturerTableViewCell.h"
@interface VideoDetailViewController ()<UITableViewDataSource,UITableViewDelegate>
@end
@implementation VideoDetailViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self setUpTableView];
}
#pragma mark - UITableView
- (void)setUpTableView
{
self.studyItemDetailsTableView.tableFooterView = [UIView new];
}
#pragma mark - <UITableViewDelegate,UITableViewDataSource>
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
switch (indexPath.row) {
case StudyItemIntroCell:
{
VideoDetailIntroTableViewCell *itemDetailCell = [tableView dequeueReusableCellWithIdentifier:@"VideoDetailIntroTableViewCell" forIndexPath:indexPath];
return itemDetailCell;
}
break;
case LecturerIntroCell:
{
VideoLecturerTableViewCell *lectureCell = [tableView dequeueReusableCellWithIdentifier:@"VideoLecturerTableViewCell" forIndexPath:indexPath];
return lectureCell;
}
break;
case ContraposePersonCell:
{
VideoDetailIntroTableViewCell *scopeCell = [tableView dequeueReusableCellWithIdentifier:@"VideoDetailIntroTableViewCell" forIndexPath:indexPath];
return scopeCell;
}
break;
default:
break;
}
return nil;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 3;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
switch (indexPath.row) {
case StudyItemIntroCell:
{
return 100;
}
break;
case LecturerIntroCell:
{
return 130;
}
break;
case ContraposePersonCell:
{
return 100;
}
break;
default:
break;
}
return 0;
}
@end
//
// VideoHelperViewController.h
// Lighting
//
// Created by 曹云霄 on 2016/11/25.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
#import <AVFoundation/AVFoundation.h>
@interface VideoHelperViewController : BaseViewController
/**
播放Layer
*/
@property (nonatomic,strong) AVPlayerLayer *playerLayer;
/**
视频导航栏
*/
@property (weak, nonatomic) IBOutlet UIView *videoNavigationView;
/**
视频title
*/
@property (weak, nonatomic) IBOutlet UILabel *videoTitleLabel;
/**
视频工具类
*/
@property (weak, nonatomic) IBOutlet UIView *videoToolView;
/**
播放按钮
*/
@property (weak, nonatomic) IBOutlet UIButton *playButton;
/**
播放进度
*/
@property (weak, nonatomic) IBOutlet UIProgressView *bufferProgressView;
/**
当前播放时间
*/
@property (weak, nonatomic) IBOutlet UILabel *playingTimeLabel;
/**
总时间
*/
@property (weak, nonatomic) IBOutlet UILabel *playItemTotalTimeLabel;
/**
播放路径
*/
@property (nonatomic,copy) NSString *videoUrl;
/**
放大缩小 boolValue(true 全屏)
*/
@property (nonatomic,copy) void(^zoomButtonClickBlock)(BOOL boolValue);
@end
//
// VideoHelperViewController.m
// Lighting
//
// Created by 曹云霄 on 2016/11/25.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "VideoHelperViewController.h"
@interface VideoHelperViewController ()
@property (nonatomic,strong) AVPlayer *customPlayer;
@property (nonatomic,strong) AVPlayerItem *playerItem;
@property (nonatomic,strong) id avplayerServer;
/**
导航栏、工具类是否隐藏
*/
@property (nonatomic,assign) BOOL toolNaviViewIsHide;
@end
@implementation VideoHelperViewController
- (void)viewDidLoad
{
[super viewDidLoad];
[self uiConfigAction];
[self setUpAVPlayer];
[self addAVPlayerKVO];
[self addProgressObserver];
}
#pragma mark - UI
- (void)uiConfigAction
{
self.videoNavigationView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
self.videoToolView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
[self.view addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideOrShowNavigationBarAndToolBar)]];
}
#pragma mark - SetUp AVPlayer
- (void)setUpAVPlayer
{
_playerItem = [[AVPlayerItem alloc]initWithURL:[NSURL URLWithString:self.videoUrl]];
_customPlayer = [[AVPlayer alloc] initWithPlayerItem:_playerItem];
_playerLayer = [AVPlayerLayer playerLayerWithPlayer:_customPlayer];
_playerLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
_playerLayer.frame = CGRectMake(0, 0, ScreenWidth*2/3, ScreenHeight/2);
[self.view.layer insertSublayer:_playerLayer atIndex:0];
[self CreateMBProgressHUDLoding];
//设置静音模式播放声音
AVAudioSession * session = [AVAudioSession sharedInstance];
[session setCategory:AVAudioSessionCategoryPlayback error:nil];
[session setActive:YES error:nil];
}
#pragma mark - AVPlayer KVO
- (void)addAVPlayerKVO
{
//播放状态属性
[self.playerItem addObserver:self forKeyPath:@"status" options:NSKeyValueObservingOptionNew context:nil];
//监控网络加载情况属性
[self.playerItem addObserver:self forKeyPath:@"loadedTimeRanges" options:NSKeyValueObservingOptionNew context:nil];
//给AVPlayerItem添加播放完成通知
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playFinish) name:AVPlayerItemDidPlayToEndTimeNotification object:nil];
}
#pragma mark -KVO回调
-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context{
if ([keyPath isEqualToString:@"status"]) {//播放状态
NSInteger status = [[change objectForKey:NSKeyValueChangeNewKey] integerValue];
switch (status) {
case AVPlayerStatusFailed:
[self ErrorMBProgressView:@"播放失败"];
break;
case AVPlayerStatusReadyToPlay://正在播放
[self RemoveMBProgressHUDLoding];
self.playItemTotalTimeLabel.text = [NSString stringWithFormat:@"/ %@",[self convertTime:CMTimeGetSeconds(self.playerItem.duration)]];
break;
default:
break;
}
}else if ([keyPath isEqualToString:@"loadedTimeRanges"]){//缓冲
NSTimeInterval timeInterval = [self availableDuration];// 计算缓冲进度
if (timeInterval > self.getCurrentPlayingTime+5){ // 缓存 大于 播放 当前时长+5
[self.customPlayer play];
}
}
}
#pragma mark - 返回当前视频播放时长
- (double)getCurrentPlayingTime{
return self.customPlayer.currentTime.value/self.customPlayer.currentTime.timescale;
}
#pragma mark - 返回当前视频缓存时长
- (NSTimeInterval)availableDuration{
NSArray *loadedTimeRanges = [[self.customPlayer currentItem] loadedTimeRanges];
CMTimeRange timeRange = [loadedTimeRanges.firstObject CMTimeRangeValue];// 获取缓冲区域
float startSeconds = CMTimeGetSeconds(timeRange.start);
float durationSeconds = CMTimeGetSeconds(timeRange.duration);
NSTimeInterval result = startSeconds + durationSeconds;// 计算缓冲总进度
return result;
}
#pragma mark -播放进度条更新
-(void)addProgressObserver {
WS(weakSelf);
AVPlayerItem *playerItem = self.customPlayer.currentItem;
self.avplayerServer = [self.customPlayer addPeriodicTimeObserverForInterval:CMTimeMake(1.0, 1.0) queue:dispatch_get_main_queue() usingBlock:^(CMTime time){
float current = CMTimeGetSeconds(time);
float total = CMTimeGetSeconds(playerItem.duration);
//更新进度条
float progress = current/total;
weakSelf.bufferProgressView.progress = progress;
//更新播放时间
CMTime ctime = weakSelf.customPlayer.currentTime;
weakSelf.playingTimeLabel.text = [weakSelf convertTime:ctime.value/ctime.timescale];
}];
}
#pragma mark - 隐藏(显示)状态栏、工具栏
- (void)hideOrShowNavigationBarAndToolBar
{
WS(weakSelf);
[UIView animateWithDuration:0.4 animations:^{
weakSelf.videoNavigationView.alpha = weakSelf.toolNaviViewIsHide?1:0;
weakSelf.videoToolView.alpha = weakSelf.toolNaviViewIsHide?1:0;
}completion:^(BOOL finished) {
weakSelf.toolNaviViewIsHide = !weakSelf.toolNaviViewIsHide;
}];
}
#pragma mark -计算时间
- (NSString *)convertTime:(CGFloat)second
{
NSDate *date = [NSDate dateWithTimeIntervalSince1970:second];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
if (second/3600 >= 1) {
[formatter setDateFormat:@"HH:mm:ss"];
} else {
[formatter setDateFormat:@"mm:ss"];
}
NSString *showtimeNew = [formatter stringFromDate:date];
return showtimeNew;
}
#pragma mark - 播放完成
- (void)playFinish
{
[self.customPlayer seekToTime:kCMTimeZero];
self.playButton.selected = YES;
}
#pragma mark - 播放、暂停
- (IBAction)playOrPauseButtonClickAction:(UIButton *)sender {
sender.selected = !sender.selected;
if (sender.selected) {
[self.customPlayer pause];
}else {
[self.customPlayer play];
}
}
#pragma mark - 退出播放
- (IBAction)exitPlayControllerButtonClick:(UIButton *)sender {
[self.customPlayer pause];
[self.navigationController popViewControllerAnimated:YES];
}
#pragma mark - 后退5秒
- (IBAction)backFiveSecondButtnClick:(UIButton *)sender {
[self.customPlayer seekToTime:CMTimeMake(5, 1)];
}
#pragma mark - 放大缩小按钮
- (IBAction)zoomButtonClick:(UIButton *)sender {
sender.selected = !sender.selected;
if (self.zoomButtonClickBlock) {
self.zoomButtonClickBlock(sender.selected);
}
}
#pragma mark - 释放KVO
- (void)dealloc
{
[self.playerItem removeObserver:self forKeyPath:@"status"];
[self.playerItem removeObserver:self forKeyPath:@"loadedTimeRanges"];
[self.customPlayer removeTimeObserver:self.avplayerServer];
}
@end
//
// VideoLecturerTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 2016/11/25.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface VideoLecturerTableViewCell : UITableViewCell
/**
讲师介绍标题
*/
@property (weak, nonatomic) IBOutlet UILabel *lecturerTitleLabel;
/**
讲师头像
*/
@property (weak, nonatomic) IBOutlet UIImageView *lecturerImageView;
/**
讲师名字
*/
@property (weak, nonatomic) IBOutlet UILabel *lecturerNameLabel;
/**
讲师介绍
*/
@property (weak, nonatomic) IBOutlet UILabel *lecurerIntroLabel;
@end
//
// VideoLecturerTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 2016/11/25.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "VideoLecturerTableViewCell.h"
@implementation VideoLecturerTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// VideoListItemTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 2016/11/25.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface VideoListItemTableViewCell : UITableViewCell
/**
播放状态按钮
*/
@property (weak, nonatomic) IBOutlet UIButton *playButton;
/**
简介
*/
@property (weak, nonatomic) IBOutlet UILabel *studyItemTitleLabel;
/**
播放进度
*/
@property (weak, nonatomic) IBOutlet PNCircleChart *seekbarView;
/**
学习时间
*/
@property (weak, nonatomic) IBOutlet UILabel *studyItemTimeLabel;
@end
//
// VideoListItemTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 2016/11/25.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "VideoListItemTableViewCell.h"
@implementation VideoListItemTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// VideoListSectionHeaderView.h
// Lighting
//
// Created by 曹云霄 on 2016/11/25.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface VideoListSectionHeaderView : UITableViewCell
/**
学习项 Section Title
*/
@property (weak, nonatomic) IBOutlet UILabel *studyItemSectionLabel;
@end
//
// VideoListSectionHeaderView.m
// Lighting
//
// Created by 曹云霄 on 2016/11/25.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "VideoListSectionHeaderView.h"
@implementation VideoListSectionHeaderView
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// VideoListViewController.h
// Lighting
//
// Created by 曹云霄 on 2016/11/25.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface VideoListViewController : BaseViewController
/**
学习列表
*/
@property (weak, nonatomic) IBOutlet UITableView *studyListTableView;
/**
学习类别
*/
@property (weak, nonatomic) IBOutlet UILabel *studyItemTitleLabel;
@end
//
// VideoListViewController.m
// Lighting
//
// Created by 曹云霄 on 2016/11/25.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "VideoListViewController.h"
#import "VideoListItemTableViewCell.h"
#import "VideoListSectionHeaderView.h"
@interface VideoListViewController ()<UITableViewDelegate,UITableViewDataSource>
@end
@implementation VideoListViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self setUpTableView];
}
#pragma mark - UITableView
- (void)setUpTableView
{
self.studyListTableView.tableFooterView = [UIView new];
self.studyListTableView.rowHeight = 50;
self.studyListTableView.sectionHeaderHeight = 60;
}
#pragma mark - <UITableViewDelegate,UITableViewDataSource>
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
VideoListItemTableViewCell *studyItemCell = [tableView dequeueReusableCellWithIdentifier:@"VideoListItemTableViewCell" forIndexPath:indexPath];
return studyItemCell;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 10;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
VideoListSectionHeaderView *headerView = [tableView dequeueReusableCellWithIdentifier:@"VideoListSectionHeaderView"];
return headerView;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 2;
}
@end
......@@ -219,12 +219,9 @@
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......@@ -351,10 +348,8 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......@@ -447,9 +442,7 @@
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
[weakSelf RemoveMBProgressHUDLoding];
}];
}
......
......@@ -147,10 +147,8 @@
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......
......@@ -97,10 +97,8 @@
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......
......@@ -205,7 +205,6 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
dispatch_group_leave(group);
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
......@@ -252,11 +251,9 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
} WithErrorCodeBlock:^(id errorCodeValue) {
dispatch_group_leave(group);
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
dispatch_group_leave(group);
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
......@@ -339,11 +336,9 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
} WithErrorCodeBlock:^(id errorCodeValue) {
dispatch_group_leave(group);
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
dispatch_group_leave(group);
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......@@ -370,11 +365,9 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
} WithErrorCodeBlock:^(id errorCodeValue) {
dispatch_group_leave(group);
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
dispatch_group_leave(group);
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
// 完成后回调
......@@ -576,10 +569,8 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......@@ -1072,10 +1063,8 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}]];
......
......@@ -61,10 +61,8 @@
}
[weakSelf.prizeExchangeDetailsTableView reloadData];
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......
......@@ -104,11 +104,8 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......@@ -397,10 +394,8 @@
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:@"添加购物车失败"];
}];
}
......
......@@ -191,9 +191,7 @@
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf endRefreshingForTableView:weakSelf.productCollectionView];
[weakSelf ErrorMBProgressView:NETWORK];
[weakSelf RemoveMBProgressHUDLoding];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......@@ -360,15 +358,10 @@
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf endRefreshingForTableView:self.productCollectionView];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(id error) {
[weakSelf endRefreshingForTableView:self.productCollectionView];
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:@"查询失败"];
}];
}
......@@ -729,10 +722,8 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:NETWORK];
} WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:@"加入购物车失败"];
}];
}
......
......@@ -162,7 +162,6 @@
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(id error) {
......@@ -199,11 +198,9 @@
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf endRefreshingForTableView:weakSelf.seceneLibararyCollectionView];
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf endRefreshingForTableView:weakSelf.seceneLibararyCollectionView];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
......
......@@ -167,10 +167,8 @@
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......
......@@ -488,10 +488,8 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......
......@@ -218,12 +218,9 @@
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding];
}];
}
......@@ -322,11 +319,8 @@
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:@"无网络"];
} WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding];
}];
}
......
......@@ -154,11 +154,8 @@
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......@@ -423,10 +420,8 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
return;
......
......@@ -270,11 +270,9 @@
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf endRefreshingForTableView:weakSelf.shoppingTableview];
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.shoppingTableview];
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......@@ -396,10 +394,8 @@
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}];
......@@ -498,10 +494,8 @@
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......@@ -578,10 +572,8 @@
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
......
This diff is collapsed.
{
"images" : [
{
"idiom" : "universal",
"filename" : "amplification.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "amplification@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "amplification@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "back.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "back@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "back@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "back5second.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "back5second@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "back5second@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "left.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "left@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "left@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "photo.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "photo@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "photo@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "play.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "play@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "play@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "playSelect.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "playSelect@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "playSelect@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "playSelectNew.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "playSelectNew@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "playSelectNew@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "ppt.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ppt@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ppt@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "pptselect.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "pptselect@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "pptselect@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "right.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "right@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "right@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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