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

修改项说明:闯关开发

parent dd59e8ec
...@@ -175,10 +175,10 @@ ...@@ -175,10 +175,10 @@
- (void)getAnnouncementDatas:(BOOL)isRemove - (void)getAnnouncementDatas:(BOOL)isRemove
{ {
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [XBLoadingView showHUDViewWithDefault];;
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(AFFICHELIST) WithCallClass:weakSelf WithRequestType:ZERO WithParameter:self.afficheModel WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(AFFICHELIST) WithRequestType:ZERO WithParameter:self.afficheModel WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [XBLoadingView hideHUDViewWithDefault];
[weakSelf endRefreshingForTableView:weakSelf.announcementTableView]; [weakSelf endRefreshingForTableView:weakSelf.announcementTableView];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
if (isRemove) { if (isRemove) {
...@@ -188,16 +188,13 @@ ...@@ -188,16 +188,13 @@
weakSelf.totalPage = respone.totalpages; weakSelf.totalPage = respone.totalpages;
[weakSelf.afficheArray addObjectsFromArray:respone.afficheEntity]; [weakSelf.afficheArray addObjectsFromArray:respone.afficheEntity];
}else { }else {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [XBLoadingView showHUDViewWithText:returnValue[@"message"]];
} }
[weakSelf.announcementTableView reloadData]; [weakSelf.announcementTableView reloadData];
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf endRefreshingForTableView:weakSelf.announcementTableView];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.announcementTableView]; [weakSelf endRefreshingForTableView:weakSelf.announcementTableView];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [XBLoadingView showHUDViewWithText:error.localizedDescription];
}]; }];
} }
......
...@@ -99,24 +99,22 @@ ...@@ -99,24 +99,22 @@
- (void)getAnnouncementDetailsDatasAction - (void)getAnnouncementDetailsDatasAction
{ {
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [XBLoadingView showHUDViewWithDefault];;
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(AFFICHEdETAILS),self.announcementID] WithCallClass:weakSelf WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(AFFICHEdETAILS),self.announcementID] WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
weakSelf.afficheResult = [[TOAfficheEntity alloc]initWithDictionary:returnValue[@"data"] error:nil]; weakSelf.afficheResult = [[TOAfficheEntity alloc]initWithDictionary:returnValue[@"data"] error:nil];
WkWebViewViewController *webView = [weakSelf.childViewControllers firstObject]; WkWebViewViewController *webView = [weakSelf.childViewControllers firstObject];
webView.htmlString = weakSelf.afficheResult.content; webView.htmlString = weakSelf.afficheResult.content;
[weakSelf setUpTableViewHeaderView:weakSelf.afficheResult]; [weakSelf setUpTableViewHeaderView:weakSelf.afficheResult];
}else { }else {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [XBLoadingView showHUDViewWithText:returnValue[@"message"]];
} }
[weakSelf.announcementDetailsTableView reloadData]; [weakSelf.announcementDetailsTableView reloadData];
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription]; [XBLoadingView showHUDViewWithText:error.localizedDescription];
}]; }];
} }
......
...@@ -47,11 +47,11 @@ ...@@ -47,11 +47,11 @@
#pragma mark - <UIWebViewDelegate> #pragma mark - <UIWebViewDelegate>
- (void)webViewDidStartLoad:(UIWebView *)webView - (void)webViewDidStartLoad:(UIWebView *)webView
{ {
[self CreateMBProgressHUDLoding]; [XBLoadingView showHUDViewWithDefault];;
} }
- (void)webViewDidFinishLoad:(UIWebView *)webView - (void)webViewDidFinishLoad:(UIWebView *)webView
{ {
[self RemoveMBProgressHUDLoding]; [XBLoadingView hideHUDViewWithDefault];
webView.height = webView.scrollView.contentSize.height; webView.height = webView.scrollView.contentSize.height;
if (self.contentHeight) { if (self.contentHeight) {
self.contentHeight(webView.scrollView.contentSize.height+20); self.contentHeight(webView.scrollView.contentSize.height+20);
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{ {
[self ErrorMBProgressView:@"加载失败"]; [XBLoadingView showHUDViewWithText:@"加载失败"];
} }
......
...@@ -110,16 +110,16 @@ ...@@ -110,16 +110,16 @@
- (IBAction)submitButtonClickAction:(UIButton *)sender { - (IBAction)submitButtonClickAction:(UIButton *)sender {
if ([[self class] isBlankString:self.consigneeTextField.text]) { if ([[self class] isBlankString:self.consigneeTextField.text]) {
[self ErrorMBProgressView:@"收货人不能为空"];return; [XBLoadingView showHUDViewWithText:@"收货人不能为空"];return;
} }
if ([[self class] isBlankString:self.mobileTextField.text]) { if ([[self class] isBlankString:self.mobileTextField.text]) {
[self ErrorMBProgressView:@"联系电话不能为空"];return; [XBLoadingView showHUDViewWithText:@"联系电话不能为空"];return;
} }
if ([[self class] isBlankString:self.addressButton.currentTitle]) { if ([[self class] isBlankString:self.addressButton.currentTitle]) {
[self ErrorMBProgressView:@"地址不能为空"];return; [XBLoadingView showHUDViewWithText:@"地址不能为空"];return;
} }
if ([[self class] isBlankString:self.addressDetailsTextField.text]) { if ([[self class] isBlankString:self.addressDetailsTextField.text]) {
[self ErrorMBProgressView:@"详细地址不能为空"];return; [XBLoadingView showHUDViewWithText:@"详细地址不能为空"];return;
} }
[self savePrizeRecord]; [self savePrizeRecord];
} }
...@@ -128,20 +128,20 @@ ...@@ -128,20 +128,20 @@
- (void)savePrizeRecord - (void)savePrizeRecord
{ {
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [XBLoadingView showHUDViewWithDefault];;
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(SAVEPRIZEBILL) WithCallClass:weakSelf WithRequestType:ZERO WithParameter:self.prizeBill WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(SAVEPRIZEBILL) WithRequestType:ZERO WithParameter:self.prizeBill WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weakSelf SuccessMBProgressView:@"申请成功"]; [XBLoadingView showHUDViewWithSuccessText:@"申请成功" completeBlock:^{
[weakSelf dismissViewControllerAnimated:YES completion:nil]; [weakSelf dismissViewControllerAnimated:YES completion:nil];
}];
}else { }else {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [XBLoadingView showHUDViewWithText:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription]; [XBLoadingView showHUDViewWithText:error.localizedDescription];
}]; }];
} }
......
...@@ -269,9 +269,10 @@ ...@@ -269,9 +269,10 @@
[XBLoadingView hideHUDViewWithDefault]; [XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
weakSelf.isRefreshValue = NO; [XBLoadingView showHUDViewWithSuccessText:@"激活成功" completeBlock:^{
[weakSelf.dontUseCardCollectionView.mj_header beginRefreshing]; weakSelf.isRefreshValue = NO;
[XBLoadingView showHUDViewWithSuccessText:@"激活成功"]; [weakSelf.dontUseCardCollectionView.mj_header beginRefreshing];
}];
}else{ }else{
[XBLoadingView showHUDViewWithText:returnValue[@"message"]]; [XBLoadingView showHUDViewWithText:returnValue[@"message"]];
......
...@@ -84,16 +84,12 @@ ...@@ -84,16 +84,12 @@
[XBLoadingView hideHUDViewWithDefault]; [XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
//保存最新的账号信息 //保存最新的账号信息
[Shoppersmanager manager].passWordString = weakSelf.NewPassWord.text; [Shoppersmanager manager].passWordString = weakSelf.NewPassWord.text;
[XBLoadingView showHUDViewWithSuccessText:returnValue[@"message"]];
if ([weakSelf.delegate respondsToSelector:@selector(cancelButtonClick)]) { if ([weakSelf.delegate respondsToSelector:@selector(cancelButtonClick)]) {
[weakSelf.delegate cancelButtonClick]; [weakSelf.delegate cancelButtonClick];
} }
}else }else{
{
[XBLoadingView showHUDViewWithText:returnValue[@"message"]]; [XBLoadingView showHUDViewWithText:returnValue[@"message"]];
} }
}WithFailureBlock:^(id error) { }WithFailureBlock:^(id error) {
......
...@@ -445,8 +445,9 @@ ...@@ -445,8 +445,9 @@
[XBLoadingView hideHUDViewWithDefault]; [XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
block(); [XBLoadingView showHUDViewWithSuccessText:@"修改成功" completeBlock:^{
[XBLoadingView showHUDViewWithSuccessText:@"修改成功"]; block();
}];
}else }else
{ {
[XBLoadingView showHUDViewWithText:returnValue[@"message"]]; [XBLoadingView showHUDViewWithText:returnValue[@"message"]];
...@@ -580,11 +581,11 @@ ...@@ -580,11 +581,11 @@
if (!isChange) { if (!isChange) {
customerEntity.fid = returnValue[@"data"]; customerEntity.fid = returnValue[@"data"];
[Customermanager manager].model = customerEntity; [Customermanager manager].model = customerEntity;
[XBLoadingView showHUDViewWithSuccessText:@"新增成功"]; [XBLoadingView showHUDViewWithSuccessText:@"新增成功" completeBlock:nil];
[weakSelf addAddressInformationRequest]; [weakSelf addAddressInformationRequest];
}else }else
{ {
[XBLoadingView showHUDViewWithSuccessText:@"修改成功"]; [XBLoadingView showHUDViewWithSuccessText:@"修改成功" completeBlock:nil];
[weakSelf.changePersonInformationButton setTitle:@"更改客户信息" forState:UIControlStateNormal]; [weakSelf.changePersonInformationButton setTitle:@"更改客户信息" forState:UIControlStateNormal];
} }
//保存客户信息 //保存客户信息
......
...@@ -336,7 +336,7 @@ ...@@ -336,7 +336,7 @@
[XBLoadingView hideHUDViewWithDefault]; [XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
[XBLoadingView showHUDViewWithSuccessText:@"撤销成功"]; [XBLoadingView showHUDViewWithSuccessText:@"撤销成功" completeBlock:nil];
model.order.orderState = @"005"; model.order.orderState = @"005";
NSIndexPath *indexapath = [NSIndexPath indexPathForRow:cellindex inSection:0]; NSIndexPath *indexapath = [NSIndexPath indexPathForRow:cellindex inSection:0];
[weakSelf.customerOrderTableView reloadRowsAtIndexPaths:@[indexapath] withRowAnimation:UITableViewRowAnimationLeft]; [weakSelf.customerOrderTableView reloadRowsAtIndexPaths:@[indexapath] withRowAnimation:UITableViewRowAnimationLeft];
......
...@@ -93,11 +93,11 @@ ...@@ -93,11 +93,11 @@
- (void)queryIntegralDetails:(BOOL)isRemove - (void)queryIntegralDetails:(BOOL)isRemove
{ {
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [XBLoadingView showHUDViewWithDefault];;
NSString *url = [NSString stringWithFormat:SERVERREQUESTURL(INTEGRALQUERY),[Shoppersmanager manager].Shoppers.employee.fid]; NSString *url = [NSString stringWithFormat:SERVERREQUESTURL(INTEGRALQUERY),[Shoppersmanager manager].Shoppers.employee.fid];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:url WithCallClass:weakSelf WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:url WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [XBLoadingView hideHUDViewWithDefault];
[weakSelf endRefreshingForTableView:weakSelf.integralDetailsTableView]; [weakSelf endRefreshingForTableView:weakSelf.integralDetailsTableView];
weakSelf.integralDetailsTableView.emptyDataSetSource = weakSelf; weakSelf.integralDetailsTableView.emptyDataSetSource = weakSelf;
weakSelf.integralDetailsTableView.emptyDataSetDelegate = weakSelf; weakSelf.integralDetailsTableView.emptyDataSetDelegate = weakSelf;
...@@ -111,16 +111,13 @@ ...@@ -111,16 +111,13 @@
weakSelf.returnIntegralDetailsBlock(integralDatas); weakSelf.returnIntegralDetailsBlock(integralDatas);
} }
}else { }else {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [XBLoadingView showHUDViewWithText:returnValue[@"message"]];
} }
[weakSelf.integralDetailsTableView reloadData]; [weakSelf.integralDetailsTableView reloadData];
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.integralDetailsTableView]; [weakSelf endRefreshingForTableView:weakSelf.integralDetailsTableView];
[weakSelf ErrorMBProgressView:NETWORK]; [XBLoadingView showHUDViewWithText:error.localizedDescription];
} WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.integralDetailsTableView];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
} }
...@@ -128,11 +125,11 @@ ...@@ -128,11 +125,11 @@
- (void)queryPrizeDetails:(BOOL)isRemove - (void)queryPrizeDetails:(BOOL)isRemove
{ {
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [XBLoadingView showHUDViewWithDefault];;
NSString *url = [NSString stringWithFormat:SERVERREQUESTURL(ALLEXCHANGERECORD),[Shoppersmanager manager].Shoppers.employee.fid]; NSString *url = [NSString stringWithFormat:SERVERREQUESTURL(ALLEXCHANGERECORD),[Shoppersmanager manager].Shoppers.employee.fid];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:url WithCallClass:weakSelf WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:url WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [XBLoadingView hideHUDViewWithDefault];
[weakSelf endRefreshingForTableView:weakSelf.integralDetailsTableView]; [weakSelf endRefreshingForTableView:weakSelf.integralDetailsTableView];
weakSelf.integralDetailsTableView.emptyDataSetSource = weakSelf; weakSelf.integralDetailsTableView.emptyDataSetSource = weakSelf;
weakSelf.integralDetailsTableView.emptyDataSetDelegate = weakSelf; weakSelf.integralDetailsTableView.emptyDataSetDelegate = weakSelf;
...@@ -143,16 +140,13 @@ ...@@ -143,16 +140,13 @@
RsPrizeBillResponse *integralDatas = [[RsPrizeBillResponse alloc]initWithDictionary:returnValue[@"data"] error:nil]; RsPrizeBillResponse *integralDatas = [[RsPrizeBillResponse alloc]initWithDictionary:returnValue[@"data"] error:nil];
[weakSelf.datasArray addObjectsFromArray:integralDatas.bills]; [weakSelf.datasArray addObjectsFromArray:integralDatas.bills];
}else { }else {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [XBLoadingView showHUDViewWithText:returnValue[@"message"]];
} }
[weakSelf.integralDetailsTableView reloadData]; [weakSelf.integralDetailsTableView reloadData];
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf endRefreshingForTableView:weakSelf.integralDetailsTableView];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.integralDetailsTableView]; [weakSelf endRefreshingForTableView:weakSelf.integralDetailsTableView];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [XBLoadingView showHUDViewWithText:error.localizedDescription];
}]; }];
} }
......
...@@ -33,20 +33,18 @@ ...@@ -33,20 +33,18 @@
- (void)getForumAllTypeAction - (void)getForumAllTypeAction
{ {
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [XBLoadingView showHUDViewWithDefault];;
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(FORUMTYPS) WithCallClass:weakSelf WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(FORUMTYPS) WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
NSLog(@"%@",returnValue); NSLog(@"%@",returnValue);
[weakSelf RemoveMBProgressHUDLoding]; [XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
}else{ }else{
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [XBLoadingView showHUDViewWithText:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription]; [XBLoadingView showHUDViewWithText:error.localizedDescription];
}]; }];
} }
......
...@@ -42,23 +42,21 @@ ...@@ -42,23 +42,21 @@
- (void)queryIntegralDetails - (void)queryIntegralDetails
{ {
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [XBLoadingView showHUDViewWithDefault];;
NSString *url = [NSString stringWithFormat:SERVERREQUESTURL(INTEGRALQUERY),[Shoppersmanager manager].Shoppers.employee.fid]; NSString *url = [NSString stringWithFormat:SERVERREQUESTURL(INTEGRALQUERY),[Shoppersmanager manager].Shoppers.employee.fid];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:url WithCallClass:weakSelf WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:url WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
RsScoreDetails *integralDatas = [[RsScoreDetails alloc]initWithDictionary:returnValue[@"data"] error:nil]; RsScoreDetails *integralDatas = [[RsScoreDetails alloc]initWithDictionary:returnValue[@"data"] error:nil];
[weakSelf setUpIntegral:integralDatas]; [weakSelf setUpIntegral:integralDatas];
}else { }else {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [XBLoadingView showHUDViewWithText:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:NETWORK]; [XBLoadingView showHUDViewWithText:error.localizedDescription];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
} }
......
...@@ -17,9 +17,24 @@ ...@@ -17,9 +17,24 @@
*/ */
@property (weak, nonatomic) IBOutlet UILabel *titleLabel; @property (weak, nonatomic) IBOutlet UILabel *titleLabel;
/** /**
序列号 考核
*/ */
@property (weak, nonatomic) IBOutlet UILabel *serialNumberLable; @property (nonatomic,strong) CustomTOStudyTopicEntity *questionEntity;
/***************闯关调用***************/
/**
问题
*/
@property (weak, nonatomic) IBOutlet UILabel *questionLabel;
/**
闯关
*/
@property (nonatomic,strong) CustomTOPassLevelTopicEntity *emigratedEntity;
@end @end
...@@ -12,13 +12,31 @@ ...@@ -12,13 +12,31 @@
- (void)awakeFromNib { - (void)awakeFromNib {
[super awakeFromNib]; [super awakeFromNib];
// Initialization code
} }
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state - (void)setQuestionEntity:(CustomTOStudyTopicEntity *)questionEntity
{
_questionEntity = questionEntity;
if (_questionEntity) {
NSString *type = [NSString stringWithFormat:@"[%@]",[BaseViewController returnTopicTypeTitle:_questionEntity.topicType]];
NSString *string = [NSString stringWithFormat:@"%ld、%@_____ %@",_questionEntity.lineNo,_questionEntity.title,type];
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc]initWithString:string];
[attributedString addAttribute:NSForegroundColorAttributeName value:kMainBlueColor range:NSMakeRange(attributedString.length-[type length], [type length])];
self.titleLabel.attributedText = attributedString;
self.titleLabel.height = _questionEntity.titleHeight-40;
}
}
- (void)setEmigratedEntity:(CustomTOPassLevelTopicEntity *)emigratedEntity
{
_emigratedEntity = emigratedEntity;
if (_emigratedEntity) {
NSString *type = [NSString stringWithFormat:@"[%@]",[BaseViewController returnTopicTypeTitle:_emigratedEntity.topicType]];
NSString *string = [NSString stringWithFormat:@"%ld、%@_____ %@",_emigratedEntity.lineNo,_emigratedEntity.title,type];
self.questionLabel.text = string;
self.questionLabel.height = _emigratedEntity.titleHeight-23;
}
} }
@end @end
//
// AssessmentQualifiedViewController.h
// Lighting
//
// Created by 曹云霄 on 2016/12/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@protocol BackDelegate <NSObject>
@required
/**
返回
*/
- (void)backClickAction;
@end
@interface AssessmentQualifiedViewController : BaseViewController
@property (nonatomic,weak) id<BackDelegate>delegate;
/**
得分
*/
@property (weak, nonatomic) IBOutlet UILabel *scoreLabel;
/**
合格
*/
@property (weak, nonatomic) IBOutlet UILabel *qualifiedLabel;
/**
获得积分
*/
@property (weak, nonatomic) IBOutlet UILabel *integralLabel;
/**
总得分
*/
@property (nonatomic,copy) NSString *allScore;
/**
积分
*/
@property (nonatomic,copy) NSString *intrgral;
@end
//
// AssessmentQualifiedViewController.m
// Lighting
//
// Created by 曹云霄 on 2016/12/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "AssessmentQualifiedViewController.h"
@interface AssessmentQualifiedViewController ()
@end
@implementation AssessmentQualifiedViewController
- (void)viewDidLoad {
[super viewDidLoad];
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"您的得分为 %@",self.allScore]];
NSRange range = NSMakeRange(attributedString.length-[self.allScore length], [self.allScore length]); [attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:range];
[attributedString addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"HelveticaNeue-Bold" size:25] range:range];
self.scoreLabel.attributedText = attributedString;
self.integralLabel.text = [NSString stringWithFormat:@"%@",self.intrgral];
}
#pragma mark - 返回
- (IBAction)backButtonClickAction:(UIButton *)sender {
if ([self.delegate respondsToSelector:@selector(backClickAction)]) {
[self.delegate backClickAction];
}
}
@end
//
// AssessmentShortAnswerTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 2016/12/7.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AssessmentShortAnswerTableViewCell : UITableViewCell<UITextViewDelegate>
/**
简答框
*/
@property (weak, nonatomic) IBOutlet UITextView *shortAnswerTextView;
/**
闯关
*/
@property (nonatomic,strong) CustomTOPassLevelTopicEntity *entity;
@end
//
// AssessmentShortAnswerTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 2016/12/7.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "AssessmentShortAnswerTableViewCell.h"
@implementation AssessmentShortAnswerTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
self.shortAnswerTextView.delegate = self;
self.shortAnswerTextView.text = nil;
}
- (void)textViewDidEndEditing:(UITextView *)textView
{
self.entity.answer = textView.text;
}
@end
...@@ -22,4 +22,14 @@ ...@@ -22,4 +22,14 @@
*/ */
@property (weak, nonatomic) IBOutlet UILabel *answerTitleLabel; @property (weak, nonatomic) IBOutlet UILabel *answerTitleLabel;
/**
考核
*/
@property (nonatomic,strong) CustomTOStudyTopicOptionEntity *studyEntity;
/**
闯关
*/
@property (nonatomic,strong) CustomTOPassLevelTopicOptionEntity *emigratedEntity;
@end @end
...@@ -12,13 +12,35 @@ ...@@ -12,13 +12,35 @@
- (void)awakeFromNib { - (void)awakeFromNib {
[super awakeFromNib]; [super awakeFromNib];
// Initialization code self.titleNumberButton.layer.borderWidth = 1.0f;
self.titleNumberButton.layer.borderColor = [UIColor grayColor].CGColor;
} }
- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - (void)setStudyEntity:(CustomTOStudyTopicOptionEntity *)studyEntity
[super setSelected:selected animated:animated]; {
_studyEntity = studyEntity;
if (_studyEntity) {
self.answerTitleLabel.text = _studyEntity.name;
self.answerTitleLabel.height = _studyEntity.answerHeight-30;
[self.titleNumberButton setTitle:_studyEntity.value forState:UIControlStateNormal];
self.titleNumberButton.selected = _studyEntity.isSelected;
self.titleNumberButton.backgroundColor = _studyEntity.isSelected?kMainBlueColor:[UIColor whiteColor];
}
}
- (void)setEmigratedEntity:(CustomTOPassLevelTopicOptionEntity *)emigratedEntity
{
_emigratedEntity = emigratedEntity;
if (_emigratedEntity) {
self.answerTitleLabel.text = _emigratedEntity.name;
self.answerTitleLabel.height = _emigratedEntity.answerHeight-30;
[self.titleNumberButton setTitle:_emigratedEntity.value forState:UIControlStateNormal];
self.titleNumberButton.selected = _emigratedEntity.isSelected;
self.titleNumberButton.backgroundColor = _emigratedEntity.isSelected?kMainBlueColor:[UIColor whiteColor];
// Configure the view for the selected state }
} }
@end @end
//
// AssessmentUnqualifiedViewController.h
// Lighting
//
// Created by 曹云霄 on 2016/12/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@protocol UnqualifiedDelegate <NSObject>
@required
/**
重新开始
*/
- (void)startAgainAction;
/**
再学一遍
*/
- (void)learnAgainAction;
@end
@interface AssessmentUnqualifiedViewController : BaseViewController
@property (nonatomic,weak) id<UnqualifiedDelegate>delgate;
/**
得分
*/
@property (weak, nonatomic) IBOutlet UILabel *scoreLabel;
/**
不合格
*/
@property (weak, nonatomic) IBOutlet UILabel *unQualifiedLabel;
/**
总得分
*/
@property (nonatomic,copy) NSString *allScore;
/**
重考机会
*/
@property (nonatomic,assign) NSInteger opportunityCount;
@end
//
// AssessmentUnqualifiedViewController.m
// Lighting
//
// Created by 曹云霄 on 2016/12/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "AssessmentUnqualifiedViewController.h"
@interface AssessmentUnqualifiedViewController ()
@end
@implementation AssessmentUnqualifiedViewController
- (void)viewDidLoad {
[super viewDidLoad];
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"您的得分为 %@",self.allScore]];
NSRange range = NSMakeRange(attributedString.length-[self.allScore length], [self.allScore length]); [attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:range];
[attributedString addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"HelveticaNeue-Bold" size:25] range:range];
self.scoreLabel.attributedText = attributedString;
NSMutableAttributedString *attributed = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"考核不通过!(%ld次重考机会)",self.opportunityCount]];
NSString *string = [NSString stringWithFormat:@"(%ld次重考机会)",self.opportunityCount];
NSRange newRange = NSMakeRange(attributed.length-[string length], [string length]);
[attributed addAttribute:NSForegroundColorAttributeName value:[UIColor darkGrayColor] range:newRange];
[attributed addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"HelveticaNeue-Light" size:13] range:newRange];
self.unQualifiedLabel.attributedText = attributed;
}
#pragma mark - 重新开始
- (IBAction)startAgainButtonClickAction:(UIButton *)sender {
if ([self.delgate respondsToSelector:@selector(startAgainAction)]) {
[self.delgate startAgainAction];
}
}
#pragma mark - 在学一遍
- (IBAction)continueLearnButtonClickAction:(UIButton *)sender {
if ([self.delgate respondsToSelector:@selector(learnAgainAction)]) {
[self.delgate learnAgainAction];
}
}
@end
...@@ -15,17 +15,18 @@ ...@@ -15,17 +15,18 @@
/** /**
考核tableview 考核tableview
*/ */
@property (weak, nonatomic) IBOutlet UITableView *AssessmentTableView; @property (weak, nonatomic) IBOutlet UITableView *assessmentTableView;
/** /**
考核标题 考核标题
*/ */
@property (weak, nonatomic) IBOutlet UILabel *AssessmentTitleLabel; @property (weak, nonatomic) IBOutlet UILabel *assessmentTitleLabel;
/** /**
考核时间 考核时间
*/ */
@property (weak, nonatomic) IBOutlet UILabel *AssessmentTimeLabel; @property (weak, nonatomic) IBOutlet CountDownLabel *assessmentTimeLabel;
/** /**
学习任务ID 学习任务ID
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
- (CGFloat)contentHeight - (CGFloat)contentHeight
{ {
if (!_contentHeight) { if (!_contentHeight) {
_contentHeight = [self calculateStudyIntroductionHeight:self.contentString]+78; _contentHeight = [self calculateStudyIntroductionHeight:self.content]+78;
} }
return _contentHeight; return _contentHeight;
} }
......
//
// CustomTOPassLevelTopicEntity.h
// Lighting
//
// Created by 曹云霄 on 2016/12/7.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "opple_objc_json_client.h"
@interface CustomTOPassLevelTopicEntity : TOPassLevelTopicEntity
/**
问题高度
*/
@property (nonatomic,assign) CGFloat titleHeight;
@end
//
// CustomTOPassLevelTopicEntity.m
// Lighting
//
// Created by 曹云霄 on 2016/12/7.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "CustomTOPassLevelTopicEntity.h"
@implementation CustomTOPassLevelTopicEntity
- (CGFloat)titleHeight
{
if (!_titleHeight) {
NSString *type = [NSString stringWithFormat:@"[%@]",[BaseViewController returnTopicTypeTitle:self.topicType]];
NSString *string = [NSString stringWithFormat:@"%ld、%@_____ %@",self.lineNo,self.title,type];
_titleHeight = [self calculateStudyIntroductionHeight:string]+23;
}
return _titleHeight;
}
#pragma mark - 计算高度
- (CGFloat)calculateStudyIntroductionHeight:(NSString *)content
{
CGSize s = [content boundingRectWithSize:CGSizeMake(437, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:15]} context:nil].size;
return s.height;
}
@end
//
// CustomTOPassLevelTopicOptionEntity.h
// Lighting
//
// Created by 曹云霄 on 2016/12/7.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "opple_objc_json_client.h"
@interface CustomTOPassLevelTopicOptionEntity : TOPassLevelTopicOptionEntity
/**
答案高度
*/
@property (nonatomic,assign) CGFloat answerHeight;
/**
是否选中
*/
@property (nonatomic,assign) BOOL isSelected;
@end
//
// CustomTOPassLevelTopicOptionEntity.m
// Lighting
//
// Created by 曹云霄 on 2016/12/7.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "CustomTOPassLevelTopicOptionEntity.h"
@implementation CustomTOPassLevelTopicOptionEntity
- (CGFloat)answerHeight
{
if (!_answerHeight) {
_answerHeight = [self calculateStudyIntroductionHeight:self.name]+30;
}
return _answerHeight;
}
#pragma mark - 计算高度
- (CGFloat)calculateStudyIntroductionHeight:(NSString *)content
{
CGSize s = [content boundingRectWithSize:CGSizeMake(437, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:15]} context:nil].size;
return s.height;
}
@end
//
// CustomTOStudyTopicEntity.h
// Lighting
//
// Created by 曹云霄 on 2016/12/7.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "opple_objc_json_client.h"
@interface CustomTOStudyTopicEntity : TOStudyTopicEntity
/**
题目高度
*/
@property (nonatomic,assign) CGFloat titleHeight;
@end
//
// CustomTOStudyTopicEntity.m
// Lighting
//
// Created by 曹云霄 on 2016/12/7.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "CustomTOStudyTopicEntity.h"
@implementation CustomTOStudyTopicEntity
- (CGFloat)titleHeight
{
if (!_titleHeight) {
NSString *type = [NSString stringWithFormat:@"[%@]",[BaseViewController returnTopicTypeTitle:self.topicType]];
NSString *string = [NSString stringWithFormat:@"%ld、%@_____ %@",self.lineNo,self.title,type];
_titleHeight = [self calculateStudyIntroductionHeight:string]+40;
}
return _titleHeight;
}
#pragma mark - 计算高度
- (CGFloat)calculateStudyIntroductionHeight:(NSString *)content
{
CGSize s = [content boundingRectWithSize:CGSizeMake(ScreenWidth*2/3-28*2, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:13]} context:nil].size;
return s.height;
}
@end
//
// CustomTOStudyTopicOptionEntity.h
// Lighting
//
// Created by 曹云霄 on 2016/12/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "opple_objc_json_client.h"
@interface CustomTOStudyTopicOptionEntity : TOStudyTopicOptionEntity
/**
是否选中
*/
@property (nonatomic,assign) BOOL isSelected;
/**
答案高度
*/
@property (nonatomic,assign) CGFloat answerHeight;
@end
//
// CustomTOStudyTopicOptionEntity.m
// Lighting
//
// Created by 曹云霄 on 2016/12/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "CustomTOStudyTopicOptionEntity.h"
@implementation CustomTOStudyTopicOptionEntity
- (CGFloat)answerHeight
{
if (!_answerHeight) {
_answerHeight = [self calculateStudyIntroductionHeight:self.name]+30;
}
return _answerHeight;
}
#pragma mark - 计算高度
- (CGFloat)calculateStudyIntroductionHeight:(NSString *)content
{
CGSize s = [content boundingRectWithSize:CGSizeMake(ScreenWidth*2/3-28*2, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:13]} context:nil].size;
return s.height;
}
@end
...@@ -108,21 +108,19 @@ ...@@ -108,21 +108,19 @@
page.page = ONE; page.page = ONE;
page.rows = 9999; page.rows = 9999;
studyListModel.page = page; studyListModel.page = page;
[self CreateMBProgressHUDLoding]; [XBLoadingView showHUDViewWithDefault];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(STUDYLIST) WithCallClass:weakSelf WithRequestType:ZERO WithParameter:studyListModel WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(STUDYLIST) WithRequestType:ZERO WithParameter:studyListModel WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
weakSelf.studyResult = [[StudyTaskResponse alloc]initWithDictionary:returnValue[@"data"] error:nil]; weakSelf.studyResult = [[StudyTaskResponse alloc]initWithDictionary:returnValue[@"data"] error:nil];
[weakSelf transferData:weakSelf.studyResult]; [weakSelf transferData:weakSelf.studyResult];
}else { }else {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [XBLoadingView showHUDViewWithText:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:NETWORK]; [XBLoadingView showHUDViewWithText:error.localizedDescription];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
} }
......
...@@ -41,22 +41,20 @@ ...@@ -41,22 +41,20 @@
- (void)getLearningModuleData - (void)getLearningModuleData
{ {
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [XBLoadingView showHUDViewWithDefault];;
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(STUDYTYPES) WithCallClass:weakSelf WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(STUDYTYPES) WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
StudyTypeResponse *response = [[StudyTypeResponse alloc]initWithDictionary:returnValue[@"data"] error:nil]; StudyTypeResponse *response = [[StudyTypeResponse alloc]initWithDictionary:returnValue[@"data"] error:nil];
[weakSelf.studyTypeArray addObjectsFromArray:response.types]; [weakSelf.studyTypeArray addObjectsFromArray:response.types];
}else { }else {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [XBLoadingView showHUDViewWithText:returnValue[@"message"]];
} }
[weakSelf.onlineLearningCollectionView reloadData]; [weakSelf.onlineLearningCollectionView reloadData];
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:NETWORK]; [XBLoadingView showHUDViewWithText:error.localizedDescription];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
} }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
{ {
_studyEntity = studyEntity; _studyEntity = studyEntity;
if (_studyEntity) { if (_studyEntity) {
self.studyIntroDetailTitleLabel.text = _studyEntity.contentString; self.studyIntroDetailTitleLabel.text = _studyEntity.content;
self.studyIntroDetailTitleLabel.height = _studyEntity.contentHeight-78; self.studyIntroDetailTitleLabel.height = _studyEntity.contentHeight-78;
} }
} }
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
if (configuration.progress >= 1.0) { if (configuration.progress >= 1.0) {
NSLog(@"缓存完成"); NSLog(@"缓存完成");
} }
[self CreateMBProgressHUDLoding]; [XBLoadingView showHUDViewWithDefault];
self.customPlayer = [[AVPlayer alloc] initWithPlayerItem:self.playerItem]; self.customPlayer = [[AVPlayer alloc] initWithPlayerItem:self.playerItem];
self.playerLayer = [AVPlayerLayer playerLayerWithPlayer:self.customPlayer]; self.playerLayer = [AVPlayerLayer playerLayerWithPlayer:self.customPlayer];
self.playerLayer.videoGravity = AVLayerVideoGravityResizeAspectFill; self.playerLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
...@@ -103,10 +103,10 @@ ...@@ -103,10 +103,10 @@
case AVPlayerStatusFailed: case AVPlayerStatusFailed:
self.bufferProgressView.progress = ZERO; self.bufferProgressView.progress = ZERO;
self.playButton.selected = YES; self.playButton.selected = YES;
[self ErrorMBProgressView:@"播放失败"]; [XBLoadingView showHUDViewWithText:@"播放失败"];
break; break;
case AVPlayerStatusReadyToPlay://正在播放 case AVPlayerStatusReadyToPlay://正在播放
[self RemoveMBProgressHUDLoding]; [XBLoadingView hideHUDViewWithDefault];
self.playItemTotalTimeLabel.text = [NSString stringWithFormat:@"/ %@",[self convertTime:CMTimeGetSeconds(self.playerItem.duration)]]; self.playItemTotalTimeLabel.text = [NSString stringWithFormat:@"/ %@",[self convertTime:CMTimeGetSeconds(self.playerItem.duration)]];
self.playButton.selected = NO; self.playButton.selected = NO;
break; break;
...@@ -235,9 +235,11 @@ ...@@ -235,9 +235,11 @@
{ {
[self.customPlayer pause]; [self.customPlayer pause];
[self.customPlayer seekToTime:kCMTimeZero]; [self.customPlayer seekToTime:kCMTimeZero];
self.playButton.selected = YES;
self.bufferProgressView.progress = 0; self.bufferProgressView.progress = 0;
self.playingTimeLabel.text = @"00:00"; self.playingTimeLabel.text = @"00:00";
self.customPlayer = nil; self.customPlayer = nil;
[self.playerLayer removeFromSuperlayer];
} }
#pragma mark - 释放KVO #pragma mark - 释放KVO
......
//
// AnswerViewController.h
// Lighting
//
// Created by 曹云霄 on 2016/12/7.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface AnswerViewController : BaseViewController
@property (weak, nonatomic) IBOutlet UITableView *answerTableView;
/**
闯关任务ID
*/
@property (nonatomic,copy) NSString *passLevelId;
@end
This diff is collapsed.
//
// EmigratedFinishViewController.h
// Lighting
//
// Created by 曹云霄 on 2016/12/8.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface EmigratedFinishViewController : BaseViewController
/**
闯关结果
*/
@property (weak, nonatomic) IBOutlet UILabel *emigratedResultLabel;
//@property (nonatomic,assign)
@end
//
// EmigratedFinishViewController.m
// Lighting
//
// Created by 曹云霄 on 2016/12/8.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "EmigratedFinishViewController.h"
@interface EmigratedFinishViewController ()
@end
@implementation EmigratedFinishViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
#pragma mark - 完成
- (IBAction)finishButtonClickAction:(UIButton *)sender {
}
@end
...@@ -9,8 +9,9 @@ ...@@ -9,8 +9,9 @@
#import "EmigratedMainViewController.h" #import "EmigratedMainViewController.h"
#import "ThroughHistoryView.h" #import "ThroughHistoryView.h"
#import "InstructionsViewController.h" #import "InstructionsViewController.h"
#import "AnswerViewController.h"
@interface EmigratedMainViewController () @interface EmigratedMainViewController ()<WYPopoverControllerDelegate>
@property (nonatomic,strong) WYPopoverController *popover; @property (nonatomic,strong) WYPopoverController *popover;
...@@ -23,6 +24,7 @@ ...@@ -23,6 +24,7 @@
@implementation EmigratedMainViewController @implementation EmigratedMainViewController
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
...@@ -34,28 +36,25 @@ ...@@ -34,28 +36,25 @@
{ {
WS(weakSelf); WS(weakSelf);
PassLevelCondition *emigrated = [[PassLevelCondition alloc]init]; PassLevelCondition *emigrated = [[PassLevelCondition alloc]init];
emigrated.employeeIdEquals = [Shoppersmanager manager].Shoppers.employee.fid; emigrated.validEquals = YES;
emigrated.beginDateFrom = [[self class] getTimeby:-7];
emigrated.endDateTo = [[self class] getTimeby:0];
DataPage *page = [[DataPage alloc]init]; DataPage *page = [[DataPage alloc]init];
page.page = ONE; page.page = ONE;
page.rows = KROWS; page.rows = KROWS;
emigrated.page = page; emigrated.page = page;
[self CreateMBProgressHUDLoding]; [XBLoadingView showHUDViewWithDefault];;
NSLog(@"%@",[emigrated toDictionary]); NSLog(@"%@",[emigrated toDictionary]);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(THROUGHLIST) WithCallClass:weakSelf WithRequestType:ZERO WithParameter:emigrated WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(THROUGHLIST) WithRequestType:ZERO WithParameter:emigrated WithReturnValueBlock:^(id returnValue) {
NSLog(@"%@",returnValue); NSLog(@"%@",returnValue);
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
weakSelf.emigratedResponse = [[PassLevelResponse alloc]initWithDictionary:returnValue[@"data"] error:nil]; weakSelf.emigratedResponse = [[PassLevelResponse alloc]initWithDictionary:returnValue[@"data"] error:nil];
}else { }else {
[weakSelf RemoveMBProgressHUDLoding]; [XBLoadingView hideHUDViewWithDefault];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:NETWORK]; [XBLoadingView showHUDViewWithText:error.localizedDescription];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
} }
...@@ -65,12 +64,17 @@ ...@@ -65,12 +64,17 @@
CGFloat width = 100; CGFloat width = 100;
CGFloat height = 120; CGFloat height = 120;
CGFloat interval = 30; CGFloat interval = 30;
for (int i=0; i<10; i++) { for (int i=0; i<self.emigratedResponse.passLevelEntity.count; i++) {
TOPassLevelEntity *entity = self.emigratedResponse.passLevelEntity[i];
ThroughHistoryView *throughView = [ThroughHistoryView initializeView]; ThroughHistoryView *throughView = [ThroughHistoryView initializeView];
throughView.tag = i;
[throughView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(selectApplicableAction:)]];
throughView.titleLabel.text = entity.title;
throughView.endDateLabel.text = [[entity.endDate componentsSeparatedByString:@" "] firstObject];
throughView.frame = CGRectMake(i*width+i*interval, 0, width, height); throughView.frame = CGRectMake(i*width+i*interval, 0, width, height);
[self.throughHistoryBackScrollView addSubview:throughView]; [self.throughHistoryBackScrollView addSubview:throughView];
} }
self.throughHistoryBackScrollView.contentSize = CGSizeMake(10*width+9*interval, 0); self.throughHistoryBackScrollView.contentSize = CGSizeMake(self.emigratedResponse.passLevelEntity.count*width+(self.emigratedResponse.passLevelEntity.count-1)*interval, 0);
WS(weakSelf); WS(weakSelf);
[UIView animateWithDuration:0.2 animations:^{ [UIView animateWithDuration:0.2 animations:^{
sender.alpha = 0; sender.alpha = 0;
...@@ -78,6 +82,16 @@ ...@@ -78,6 +82,16 @@
}]; }];
} }
#pragma mark - 选择相应的期数
- (void)selectApplicableAction:(UITapGestureRecognizer *)sender
{
TOPassLevelEntity *entity = self.emigratedResponse.passLevelEntity[sender.view.tag];
AnswerViewController *answer = [[[self class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"AnswerViewController"];
answer.passLevelId = entity.fid;
answer.preferredContentSize = CGSizeMake(520, 400);
[self showPopoverView:answer];
}
#pragma mark - 闯关说明 #pragma mark - 闯关说明
- (IBAction)instructionsButtonClickAction:(UIButton *)sender { - (IBAction)instructionsButtonClickAction:(UIButton *)sender {
...@@ -87,12 +101,24 @@ ...@@ -87,12 +101,24 @@
[weakSelf.popover dismissPopoverAnimated:YES]; [weakSelf.popover dismissPopoverAnimated:YES];
}]; }];
instruction.preferredContentSize = CGSizeMake(ScreenWidth/2, ScreenHeight/2); instruction.preferredContentSize = CGSizeMake(ScreenWidth/2, ScreenHeight/2);
self.popover = [[WYPopoverController alloc] initWithContentViewController:instruction]; [self showPopoverView:instruction];
}
#pragma mark - 弹出框
- (void)showPopoverView:(BaseViewController *)controller
{
self.popover = [[WYPopoverController alloc] initWithContentViewController:controller];
self.popover.theme.fillBottomColor = [UIColor clearColor]; self.popover.theme.fillBottomColor = [UIColor clearColor];
self.popover.theme.fillTopColor = [UIColor clearColor]; self.popover.theme.fillTopColor = [UIColor clearColor];
self.popover.theme.glossShadowColor = [UIColor clearColor]; self.popover.theme.glossShadowColor = [UIColor clearColor];
self.popover.delegate = self;
[self.popover presentPopoverAsDialogAnimated:YES options:WYPopoverAnimationOptionFadeWithScale]; [self.popover presentPopoverAsDialogAnimated:YES options:WYPopoverAnimationOptionFadeWithScale];
} }
#pragma mark - 点击空白禁止收起
- (BOOL)popoverControllerShouldDismissPopover:(WYPopoverController *)popoverController
{
return NO;
}
@end @end
...@@ -11,6 +11,30 @@ ...@@ -11,6 +11,30 @@
@interface ThroughHistoryView : UIView @interface ThroughHistoryView : UIView
/**
title
*/
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
/**
状态图片
*/
@property (weak, nonatomic) IBOutlet UIImageView *stateImageView;
/**
截止时间
*/
@property (weak, nonatomic) IBOutlet UILabel *endDateLabel;
/**
初始化
@return ThroughHistoryView
*/
+ (instancetype)initializeView; + (instancetype)initializeView;
@end @end
...@@ -42,6 +42,11 @@ ...@@ -42,6 +42,11 @@
</imageView> </imageView>
</subviews> </subviews>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="endDateLabel" destination="7wQ-tG-CXo" id="Swb-td-LXy"/>
<outlet property="stateImageView" destination="TxV-0B-tUi" id="821-v9-PhP"/>
<outlet property="titleLabel" destination="sj3-Pj-bDO" id="G96-u7-ueJ"/>
</connections>
<point key="canvasLocation" x="-39" y="-145"/> <point key="canvasLocation" x="-39" y="-145"/>
</view> </view>
</objects> </objects>
......
...@@ -738,7 +738,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息"; ...@@ -738,7 +738,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
if (weakSelf.DelecteAndPayButtonBlock) { if (weakSelf.DelecteAndPayButtonBlock) {
weakSelf.DelecteAndPayButtonBlock(_cellindex,PAYSUCCESS); weakSelf.DelecteAndPayButtonBlock(_cellindex,PAYSUCCESS);
} }
[XBLoadingView showHUDViewWithSuccessText:@"支付成功"]; [XBLoadingView showHUDViewWithSuccessText:@"支付成功" completeBlock:nil];
weakSelf.isShowPayButton = NO; weakSelf.isShowPayButton = NO;
weakSelf.isShowHeaderView = YES; weakSelf.isShowHeaderView = YES;
weakSelf.isUserInteractionEnabled = NO; weakSelf.isUserInteractionEnabled = NO;
...@@ -995,7 +995,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息"; ...@@ -995,7 +995,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
{ {
[XBLoadingView hideHUDViewWithDefault]; [XBLoadingView hideHUDViewWithDefault];
[AirPrintManager printOrderWithdataSoure:[webView viewPrintFormatter] printSuccess:^{ [AirPrintManager printOrderWithdataSoure:[webView viewPrintFormatter] printSuccess:^{
[XBLoadingView showHUDViewWithSuccessText:@"打印成功"]; [XBLoadingView showHUDViewWithSuccessText:@"打印成功" completeBlock:nil];
} printError:^{ } printError:^{
[XBLoadingView showHUDViewWithText:@"打印失败"]; [XBLoadingView showHUDViewWithText:@"打印失败"];
}]; }];
...@@ -1029,7 +1029,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息"; ...@@ -1029,7 +1029,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@/%@/%@",SERVERREQUESTURL(RESETORDER),_orderCode,@"001",@"005"] WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@/%@/%@",SERVERREQUESTURL(RESETORDER),_orderCode,@"001",@"005"] WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[XBLoadingView hideHUDViewWithDefault]; [XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
[XBLoadingView showHUDViewWithSuccessText:@"撤销成功"]; [XBLoadingView showHUDViewWithSuccessText:@"撤销成功" completeBlock:nil];
UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 0.01)]; UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 0.01)];
[weakSelf.orderDetailsTableview beginUpdates]; [weakSelf.orderDetailsTableview beginUpdates];
weakSelf.orderDetailsTableview.tableHeaderView = view; weakSelf.orderDetailsTableview.tableHeaderView = view;
......
...@@ -50,21 +50,19 @@ ...@@ -50,21 +50,19 @@
- (void)getPrizeDetailsDataAction - (void)getPrizeDetailsDataAction
{ {
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [XBLoadingView showHUDViewWithDefault];;
NSString *url = [NSString stringWithFormat:SERVERREQUESTURL(PRIZEBILLDETAILS),self.prizeBillNumber]; NSString *url = [NSString stringWithFormat:SERVERREQUESTURL(PRIZEBILLDETAILS),self.prizeBillNumber];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:url WithCallClass:weakSelf WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:url WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
weakSelf.prizeBillResult = [[prizeOrderDetailsModel alloc]initWithDictionary:returnValue[@"data"] error:nil]; weakSelf.prizeBillResult = [[prizeOrderDetailsModel alloc]initWithDictionary:returnValue[@"data"] error:nil];
}else { }else {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [XBLoadingView showHUDViewWithText:returnValue[@"message"]];
} }
[weakSelf.prizeExchangeDetailsTableView reloadData]; [weakSelf.prizeExchangeDetailsTableView reloadData];
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription]; [XBLoadingView showHUDViewWithText:error.localizedDescription];
}]; }];
} }
......
...@@ -83,11 +83,11 @@ ...@@ -83,11 +83,11 @@
- (void)getPrizeListDatasAction:(BOOL)isRemove - (void)getPrizeListDatasAction:(BOOL)isRemove
{ {
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [XBLoadingView showHUDViewWithDefault];;
dispatch_group_t group = dispatch_group_create(); dispatch_group_t group = dispatch_group_create();
dispatch_group_enter(group); dispatch_group_enter(group);
//任务一 请求奖品列表 //任务一 请求奖品列表
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(PRIZELIST) WithCallClass:weakSelf WithRequestType:ZERO WithParameter:self.queryPrizeModel WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(PRIZELIST) WithRequestType:ZERO WithParameter:self.queryPrizeModel WithReturnValueBlock:^(id returnValue) {
dispatch_group_leave(group); dispatch_group_leave(group);
[weakSelf endRefreshingForTableView:weakSelf.prizeListCollectionView]; [weakSelf endRefreshingForTableView:weakSelf.prizeListCollectionView];
weakSelf.prizeListCollectionView.emptyDataSetSource = weakSelf; weakSelf.prizeListCollectionView.emptyDataSetSource = weakSelf;
...@@ -103,19 +103,16 @@ ...@@ -103,19 +103,16 @@
[weakSelf.prizeDatasArray addObject:model]; [weakSelf.prizeDatasArray addObject:model];
} }
}else { }else {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [XBLoadingView showHUDViewWithText:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
dispatch_group_leave(group);
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
dispatch_group_leave(group); dispatch_group_leave(group);
[weakSelf ErrorMBProgressView:error.localizedDescription]; [XBLoadingView showHUDViewWithText:error.localizedDescription];
}]; }];
//任务二 查询可申请礼品 //任务二 查询可申请礼品
dispatch_group_enter(group); dispatch_group_enter(group);
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(EXCHANGEQUALIFICATION),[Shoppersmanager manager].Shoppers.employee.fid] WithCallClass:weakSelf WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(EXCHANGEQUALIFICATION),[Shoppersmanager manager].Shoppers.employee.fid] WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
dispatch_group_leave(group); dispatch_group_leave(group);
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -124,15 +121,12 @@ ...@@ -124,15 +121,12 @@
} }
[weakSelf.availableArray addObjectsFromArray:returnValue[@"data"]]; [weakSelf.availableArray addObjectsFromArray:returnValue[@"data"]];
}else { }else {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [XBLoadingView showHUDViewWithText:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
dispatch_group_leave(group);
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
dispatch_group_leave(group); dispatch_group_leave(group);
[weakSelf ErrorMBProgressView:error.localizedDescription]; [XBLoadingView showHUDViewWithText:error.localizedDescription];
}]; }];
// 所有请求完成后 // 所有请求完成后
dispatch_group_notify(group, dispatch_get_main_queue(), ^{ dispatch_group_notify(group, dispatch_get_main_queue(), ^{
...@@ -142,7 +136,7 @@ ...@@ -142,7 +136,7 @@
model.isAllowSelect = YES; model.isAllowSelect = YES;
} }
} }
[weakSelf RemoveMBProgressHUDLoding]; [XBLoadingView hideHUDViewWithDefault];
[weakSelf endRefreshingForTableView:weakSelf.prizeListCollectionView]; [weakSelf endRefreshingForTableView:weakSelf.prizeListCollectionView];
[weakSelf.prizeListCollectionView reloadData]; [weakSelf.prizeListCollectionView reloadData];
}); });
...@@ -183,7 +177,7 @@ ...@@ -183,7 +177,7 @@
} }
} }
if (!selectArray.count) { if (!selectArray.count) {
[self ErrorMBProgressView:@"未选中任何礼品"];return; [XBLoadingView showHUDViewWithText:@"未选中任何礼品"];return;
} }
ApplyPrizeViewController *applyPrizeVC = [[ApplyPrizeViewController alloc]init]; ApplyPrizeViewController *applyPrizeVC = [[ApplyPrizeViewController alloc]init];
applyPrizeVC.preferredContentSize = applyPrizeVC.view.mj_size; applyPrizeVC.preferredContentSize = applyPrizeVC.view.mj_size;
......
...@@ -469,7 +469,7 @@ ...@@ -469,7 +469,7 @@
} }
[XBLoadingView showHUDViewWithDefault]; [XBLoadingView showHUDViewWithDefault];
WS(weakSelf); WS(weakSelf);
NSSLog(@"%@",[order toDictionary]); NSLog(@"%@",[order toDictionary]);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CONFIRMPAY) WithRequestType:ZERO WithParameter:order WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CONFIRMPAY) WithRequestType:ZERO WithParameter:order WithReturnValueBlock:^(id returnValue) {
[XBLoadingView hideHUDViewWithDefault]; [XBLoadingView hideHUDViewWithDefault];
......
...@@ -299,12 +299,12 @@ ...@@ -299,12 +299,12 @@
[XBLoadingView hideHUDViewWithDefault]; [XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
[XBLoadingView showHUDViewWithSuccessText:@"删除成功" completeBlock:^{
[XBLoadingView showHUDViewWithSuccessText:@"删除成功"]; if ([weakSelf.delegate respondsToSelector:@selector(delecteCell:)]) {
if ([weakSelf.delegate respondsToSelector:@selector(delecteCell:)]) { [weakSelf.delegate delecteCell:_model.fid];
}
[weakSelf.delegate delecteCell:_model.fid]; }];
}
}else }else
{ {
[XBLoadingView showHUDViewWithText:returnValue[@"message"]]; [XBLoadingView showHUDViewWithText:returnValue[@"message"]];
......
...@@ -478,7 +478,7 @@ ...@@ -478,7 +478,7 @@
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[weakSelf.shoppingTableview reloadData]; [weakSelf.shoppingTableview reloadData];
}); });
[XBLoadingView showHUDViewWithSuccessText:@"删除成功"]; [XBLoadingView showHUDViewWithSuccessText:@"删除成功" completeBlock:nil];
[weakSelf CalculateSelectedGoodsAllprice]; [weakSelf CalculateSelectedGoodsAllprice];
weakSelf.allSelectedButton.selected = NO; weakSelf.allSelectedButton.selected = NO;
[weakSelf.settlementButton setTitle:@"去结算(0)" forState:UIControlStateNormal]; [weakSelf.settlementButton setTitle:@"去结算(0)" forState:UIControlStateNormal];
......
...@@ -187,7 +187,7 @@ ...@@ -187,7 +187,7 @@
[XBLoadingView hideHUDViewWithDefault]; [XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
block(); block();
[XBLoadingView showHUDViewWithSuccessText:@"修改成功"]; [XBLoadingView showHUDViewWithSuccessText:@"修改成功" completeBlock:nil];
}else }else
{ {
[XBLoadingView showHUDViewWithText:returnValue[@"message"]]; [XBLoadingView showHUDViewWithText:returnValue[@"message"]];
...@@ -285,7 +285,7 @@ ...@@ -285,7 +285,7 @@
[XBLoadingView hideHUDViewWithDefault]; [XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
[XBLoadingView showHUDViewWithSuccessText:@"登陆成功"]; [XBLoadingView showHUDViewWithSuccessText:@"登陆成功" completeBlock:nil];
LoginResult *result = [[LoginResult alloc] initWithDictionary:returnValue[@"data"] error:nil]; LoginResult *result = [[LoginResult alloc] initWithDictionary:returnValue[@"data"] error:nil];
[Shoppersmanager manager].userNameString = weakSelf.userName.text; [Shoppersmanager manager].userNameString = weakSelf.userName.text;
[Shoppersmanager manager].passWordString = weakSelf.passWord.text; [Shoppersmanager manager].passWordString = weakSelf.passWord.text;
......
This diff is collapsed.
{
"images" : [
{
"idiom" : "universal",
"filename" : "editor.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "next.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "next@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "next@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "result.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "result@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "result@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "tick.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "tick@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "tick@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
This diff is collapsed.
...@@ -20,10 +20,26 @@ ...@@ -20,10 +20,26 @@
*/ */
- (void)endRefreshingForTableView:(UIScrollView *)TableView; - (void)endRefreshingForTableView:(UIScrollView *)TableView;
/**
* 获得主体的storyboard对象
*/
+ (UIStoryboard *)getMainStoryboardClass;
/**
获得公告storyboard对象
*/
+ (UIStoryboard *)getAnnouncementStoryboardClass;
/**
获得学习中心storyboard对象
*/
+ (UIStoryboard *)getLearningCenterStoryboardClass;
/** /**
* 获得我的storyboard对象 获得积分storyboard对象
*/ */
- (UIStoryboard *)getStoryboardWithName; + (UIStoryboard *)getGuideIntegralStoryboardClass;
/** /**
* 调用打印机 * 调用打印机
...@@ -89,6 +105,21 @@ ...@@ -89,6 +105,21 @@
*/ */
+ (BOOL)isBlankString:(NSString *)string; + (BOOL)isBlankString:(NSString *)string;
/**
* 获取当前时间之前或者之后的时间(之前传入负数)
*/
+ (NSString *)getTimeby:(NSInteger)day;
/**
查询兑奖单state对应文字
*/
+ (id)returnPrizeBillStateTitleColor:(NSString *)stateCode;
/**
考核题型转义
*/
+ (NSString *)returnTopicTypeTitle:(NSString *)typeCode;
/** /**
选择框 选择框
...@@ -100,4 +131,5 @@ ...@@ -100,4 +131,5 @@
@end @end
...@@ -119,9 +119,30 @@ ...@@ -119,9 +119,30 @@
} }
#pragma mark -获得我的storyboard对象 #pragma mark -获得我的storyboard对象
- (UIStoryboard *)getStoryboardWithName + (UIStoryboard *)getMainStoryboardClass
{ {
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"StoryboardwithCYX" bundle:nil]; UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"OppleMain" bundle:nil];
return storyboard;
}
#pragma mark - 获得公告storyboard对象
+ (UIStoryboard *)getAnnouncementStoryboardClass
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Announcement" bundle:nil];
return storyboard;
}
#pragma mark - 获得学习中心storyboard对象
+ (UIStoryboard *)getLearningCenterStoryboardClass
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"LearningCenter" bundle:nil];
return storyboard;
}
#pragma mark -获得积分storyboard对象
+ (UIStoryboard *)getGuideIntegralStoryboardClass
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"GuideIntegral" bundle:nil];
return storyboard; return storyboard;
} }
...@@ -137,6 +158,57 @@ ...@@ -137,6 +158,57 @@
} }
} }
#pragma mark - 考核题型转义
+ (NSString *)returnTopicTypeTitle:(NSString *)typeCode
{
if ([typeCode isEqualToString:STUDYTOPICTYPE_SINGLE]) {
return @"单选";
}
if ([typeCode isEqualToString:STUDYTOPICTYPE_MULTIPLE]) {
return @"多选";
}
if ([typeCode isEqualToString:STUDYTOPICTYPE_TRUEORFALSE]) {
return @"判断";
}
if ([typeCode isEqualToString:PASSLEVELTOPICTYPE_GAPFILLING]) {
return @"填空";
}
if ([typeCode isEqualToString:PASSLEVELTOPICTYPE_SHORTANSWER]) {
return @"简答";
}
return nil;
}
#pragma mark -查询兑奖单state对应文字
+ (id)returnPrizeBillStateTitleColor:(NSString *)stateCode
{
NSDictionary *dict;
if ([stateCode isEqualToString:@"requested"]) {
dict = @{@"title":@"已申请",@"color":RGB(127, 192, 62, 1)};
}else if ([stateCode isEqualToString:@"requested"]) {
dict = @{@"title":@"已发货",@"color":RGB(245, 185, 74, 1)};
}
return dict;
}
#pragma mark - 获取当前时间之前或者之后的时间(之前传入负数)
+ (NSString *)getTimeby:(NSInteger)day
{
NSDate*nowDate = [NSDate date];
NSDate* theDate;
if(day!=0){
NSTimeInterval oneDay = 24*60*60*1; //1天的长度
theDate = [nowDate initWithTimeIntervalSinceNow: oneDay*day];
}else{
theDate = nowDate;
}
NSDateFormatter *date_formatter = [[NSDateFormatter alloc] init];
[date_formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
NSString *the_date_str = [date_formatter stringFromDate:theDate];
return the_date_str;
}
#pragma mark 调用airPrint无线打印机 #pragma mark 调用airPrint无线打印机
- (void)callAirprintWithdata:(NSString *)PDFpath SuccessBlock:(void(^)())success ErrorBlock:(void(^)())failed - (void)callAirprintWithdata:(NSString *)PDFpath SuccessBlock:(void(^)())success ErrorBlock:(void(^)())failed
{ {
......
...@@ -347,6 +347,26 @@ extern NSString *const STUDYLIST; ...@@ -347,6 +347,26 @@ extern NSString *const STUDYLIST;
* 闯关信息 * 闯关信息
*/ */
extern NSString *const THROUGHLIST; extern NSString *const THROUGHLIST;
/**
* 提交考核结果
*/
extern NSString *const SUBMITANSWER;
/**
* 获取相应分数对应的积分
*/
extern NSString *const GETINTEGRAL;
/**
* 获取闯关详情
*/
extern NSString *const GETPASSLEVELDETAILS;
/**
* 提交闯关答案
*/
extern NSString *const SUBMITEMIGRATEDANSWER;
/*****************************************接口地址*****************************************/ /*****************************************接口地址*****************************************/
......
...@@ -341,6 +341,26 @@ NSString *const STUDYLIST = @"/study/query"; ...@@ -341,6 +341,26 @@ NSString *const STUDYLIST = @"/study/query";
* 闯关信息 * 闯关信息
*/ */
NSString *const THROUGHLIST = @"/passLevel/query"; NSString *const THROUGHLIST = @"/passLevel/query";
/**
* 提交考核结果
*/
NSString *const SUBMITANSWER = @"/study/submitStudyResult";
/**
* 获取相应分数对应的积分
*/
NSString *const GETINTEGRAL = @"/option/get/studyScore";
/**
* 获取闯关详情
*/
NSString *const GETPASSLEVELDETAILS = @"/passLevel/getPassLevel/%@";
/**
* 提交闯关答案
*/
NSString *const SUBMITEMIGRATEDANSWER = @"/passLevel/submitPassLevelResult";
/*****************************************接口地址*****************************************/ /*****************************************接口地址*****************************************/
......
//
// CountDownLabel.h
// Lighting
//
// Created by 曹云霄 on 2016/12/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CountDownLabel : UILabel
/// 根据传入的具体秒数,开始倒计时
- (void)beginCountDownWithTimeInterval:(NSTimeInterval)timerInterval;
/// 倒计时完成
@property (nonatomic,copy) void(^countDownCompleteBlock)();
/// 停止定时器
- (void)stopTimer;
@end
//
// CountDownLabel.m
// Lighting
//
// Created by 曹云霄 on 2016/12/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "CountDownLabel.h"
@interface CountDownLabel ()
/// 定时器,使用 weak 或者 strong 都行
@property (nonatomic, strong) NSTimer *timer;
/// 剩余天数
@property (nonatomic, assign) NSUInteger day;
/// 剩余小时数
@property (nonatomic, assign) NSUInteger hour;
/// 剩余分钟数
@property (nonatomic, assign) NSUInteger minute;
/// 剩余秒数
@property (nonatomic, assign) NSUInteger second;
@end
@implementation CountDownLabel
/// 根据传入的具体秒数,开始倒计时
- (void)beginCountDownWithTimeInterval:(NSTimeInterval)timerInterval {
[self initTimeParametersWithTimeInterval:timerInterval];
}
/// 通过传入的时间间隔对时间参数进行初始化
- (void)initTimeParametersWithTimeInterval:(NSInteger)interval {
NSUInteger secondPerDay = 24 * 60 * 60;
NSUInteger secondPerHour = 60 * 60;
NSUInteger secondPerMinute = 60;
// 计算天数
self.day = interval / secondPerDay;
// 剩余小时不应该大于24小时,所以应该先除去满足一天的秒数,再计算还剩下多少小时
self.hour = interval % secondPerDay / secondPerHour;
// 剩余分钟数与上面同理
self.minute = interval % secondPerHour / secondPerMinute;
// 剩余秒数直接等于秒数对每分钟秒数所取的余数
self.second = interval % secondPerMinute;
// 更新值
[self updateText];
self.timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(updateTimer) userInfo:nil repeats:YES];
[[NSRunLoop mainRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];
}
/// 时间减一秒方法
- (void)updateTimer {
// 减一秒
self.second--;
// 判断秒数
if (self.second == -1) {
self.second = 59;
self.minute--;
}
// 判断分钟数
if (self.minute == -1) {
self.minute = 59;
self.hour--;
}
// 判断小时数
if (self.hour == -1) {
self.hour = 23;
self.day--;
}
// 判断是否没时间了
if (self.day == 0 && self.hour == 0 && self.minute == 0 && self.second == 0) {
[self.timer invalidate];
if (self.countDownCompleteBlock) {
self.countDownCompleteBlock();
}
}
// 更新值
[self updateText];
}
- (void)updateText {
self.text = [NSString stringWithFormat:@"%02zd:%02zd:%02zd", self.hour, self.minute, self.second];
}
/// 停止定时器
- (void)stopTimer
{
[self.timer invalidate];
}
// best solution
- (void)removeFromSuperview {
[super removeFromSuperview];
[self.timer invalidate];
}
@end
//
// Instructions.h
// Lighting
//
// Created by 曹云霄 on 2016/12/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#ifndef Instructions_h
#define Instructions_h
// 所有NSDecimalNumber 改成 NSNumber
// @property (nonatomic, strong) NSArray<TOJingdongEcardEntity> *eCards 改成 @property (nonatomic, strong) NSMutableArray<TOJingdongEcardEntity> *eCards;
// 新增 @class CustomStudyEntity;
// 新增 @class CustomTOStudyTopicOptionEntity;
// 新增 @protocol CustomStudyEntity @end
// 新增 @protocol CustomTOStudyTopicOptionEntity @end
// @property (nonatomic, strong) NSArray<TOStudyTaskEntity> *studyTasks 改成 @property (nonatomic, strong) NSArray<CustomStudyEntity> *studyTasks;
// @property (nonatomic, strong) NSArray<TOStudyTopicOptionEntity> *options 改成 @property (nonatomic, strong) NSMutableArray<CustomTOStudyTopicOptionEntity> *options;
// @property (nonatomic, copy) NSString *content 改成 @property (nonatomic, copy) NSString *contentString
// @property (nonatomic, strong) NSArray<TOPassLevelTopicEntity> *topics; 改成 @property (nonatomic, strong) NSArray<CustomTOPassLevelTopicEntity> *topics;
// @property (nonatomic, strong) NSArray<TOPassLevelTopicOptionEntity> *options; 改成 @property (nonatomic, strong) NSMutableArray<CustomTOPassLevelTopicOptionEntity> *options;
#endif /* Instructions_h */
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
@param text 提示信息 @param text 提示信息
*/ */
+ (void)showHUDViewWithSuccessText:(NSString *)text; + (void)showHUDViewWithSuccessText:(NSString *)text completeBlock:(void(^)())finish;
/** /**
显示进度框 显示进度框
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
@param text 提示信息 @param text 提示信息
*/ */
+ (void)showHUDViewWithSuccessText:(NSString *)text + (void)showHUDViewWithSuccessText:(NSString *)text completeBlock:(void (^)())finish
{ {
XBLoadingView *hud = [XBLoadingView showHUDAddedTo:SHARED_APPDELEGATE.window animated:YES]; XBLoadingView *hud = [XBLoadingView showHUDAddedTo:SHARED_APPDELEGATE.window animated:YES];
hud.mode = MBProgressHUDModeCustomView; hud.mode = MBProgressHUDModeCustomView;
...@@ -56,6 +56,9 @@ ...@@ -56,6 +56,9 @@
hud.labelFont = [UIFont systemFontOfSize:15]; hud.labelFont = [UIFont systemFontOfSize:15];
hud.labelText = text; hud.labelText = text;
[hud hide:YES afterDelay:3]; [hud hide:YES afterDelay:3];
if (finish) {
finish = hud.completionBlock;
}
} }
/** /**
......
...@@ -42,6 +42,11 @@ ...@@ -42,6 +42,11 @@
#import "PNCircleChart.h" #import "PNCircleChart.h"
#import "CustomStudyEntity.h" #import "CustomStudyEntity.h"
#import "XBLoadingView.h" #import "XBLoadingView.h"
#import "CustomTOStudyTopicOptionEntity.h"
#import "CountDownLabel.h"
#import "CustomTOStudyTopicEntity.h"
#import "CustomTOPassLevelTopicEntity.h"
#import "CustomTOPassLevelTopicOptionEntity.h"
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
[UMSocialData defaultData].extConfig.wechatSessionData.url = shareWeb; [UMSocialData defaultData].extConfig.wechatSessionData.url = shareWeb;
[[UMSocialDataService defaultDataService] postSNSWithTypes:@[UMShareToWechatSession] content:title image:self.shareImage location:nil urlResource:nil presentedController:self completion:^(UMSocialResponseEntity *response){ [[UMSocialDataService defaultDataService] postSNSWithTypes:@[UMShareToWechatSession] content:title image:self.shareImage location:nil urlResource:nil presentedController:self completion:^(UMSocialResponseEntity *response){
if (response.responseCode == UMSResponseCodeSuccess) { if (response.responseCode == UMSResponseCodeSuccess) {
[XBLoadingView showHUDViewWithSuccessText:@"分享微信好友成功"]; [XBLoadingView showHUDViewWithSuccessText:@"分享微信好友成功" completeBlock:nil];
} }
}]; }];
} }
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
[UMSocialData defaultData].extConfig.wechatTimelineData.url = shareWeb; [UMSocialData defaultData].extConfig.wechatTimelineData.url = shareWeb;
[[UMSocialDataService defaultDataService] postSNSWithTypes:@[UMShareToWechatTimeline] content:title image:self.shareImage location:nil urlResource:nil presentedController:self completion:^(UMSocialResponseEntity *response){ [[UMSocialDataService defaultDataService] postSNSWithTypes:@[UMShareToWechatTimeline] content:title image:self.shareImage location:nil urlResource:nil presentedController:self completion:^(UMSocialResponseEntity *response){
if (response.responseCode == UMSResponseCodeSuccess) { if (response.responseCode == UMSResponseCodeSuccess) {
[XBLoadingView showHUDViewWithSuccessText:@"分享微信朋友圈成功"]; [XBLoadingView showHUDViewWithSuccessText:@"分享微信朋友圈成功" completeBlock:nil];
} }
}]; }];
} }
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
[UMSocialData defaultData].extConfig.sinaData.shareText = [NSString stringWithFormat:@"%@%@",@"欧普照明",shareWeb]; [UMSocialData defaultData].extConfig.sinaData.shareText = [NSString stringWithFormat:@"%@%@",@"欧普照明",shareWeb];
[[UMSocialDataService defaultDataService] postSNSWithTypes:@[UMShareToSina] content:title image:self.shareImage location:nil urlResource:nil presentedController:self completion:^(UMSocialResponseEntity *shareResponse){ [[UMSocialDataService defaultDataService] postSNSWithTypes:@[UMShareToSina] content:title image:self.shareImage location:nil urlResource:nil presentedController:self completion:^(UMSocialResponseEntity *shareResponse){
if (shareResponse.responseCode == UMSResponseCodeSuccess) { if (shareResponse.responseCode == UMSResponseCodeSuccess) {
[XBLoadingView showHUDViewWithSuccessText:@"分享新浪微博成功"]; [XBLoadingView showHUDViewWithSuccessText:@"分享新浪微博成功" completeBlock:nil];
} }
}]; }];
} }
......
...@@ -264,7 +264,7 @@ ...@@ -264,7 +264,7 @@
} }
[weakSelf dismissViewControllerAnimated:YES completion:nil]; [weakSelf dismissViewControllerAnimated:YES completion:nil];
[weakSelf QueryShoppingCarNumber]; [weakSelf QueryShoppingCarNumber];
[XBLoadingView showHUDViewWithSuccessText:@"加入购物车成功"]; [XBLoadingView showHUDViewWithSuccessText:@"加入购物车成功" completeBlock:nil];
}else }else
{ {
[XBLoadingView showHUDViewWithText:returnValue[@"message"]]; [XBLoadingView showHUDViewWithText:returnValue[@"message"]];
......
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