Commit 205cbfab authored by 曹云霄's avatar 曹云霄

修改项说明:修改适配

parent 38b97e53
......@@ -19,10 +19,6 @@
*/
@property (nonatomic,strong) NSMutableArray *CustomerresultArray;
/**
* 当前页数
*/
@property (nonatomic,assign) int indexPage;
/**
* 总页数
......@@ -54,8 +50,12 @@
- (ConsumerQueryCondition *)conditionModel
{
if (!_conditionModel) {
_conditionModel = [[ConsumerQueryCondition alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = ONE;
page.rows = KROWS;
_conditionModel.page = page;
_conditionModel.resellerCodeEquals = [[Shoppersmanager manager].Shoppers.employee.currentDepart orgCode];
}
return _conditionModel;
}
......@@ -63,7 +63,6 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self uiConfigAction];
}
......@@ -72,7 +71,6 @@
#pragma mark -UI
- (void)uiConfigAction
{
self.indexPage = ONE;
self.allCustomerTableview.dataSource = self;
self.allCustomerTableview.delegate = self;
self.searchTextfield.delegate = self;
......@@ -80,26 +78,6 @@
self.allCustomerTableview.backgroundColor = [UIColor clearColor];
self.searchTextfield.returnKeyType = UIReturnKeySearch;
//调整布局
[self.begindateButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.RecentlydateLabe.mas_right).mas_offset(0);
make.top.equalTo(self.RecentlydateLabe).mas_offset(-4);
make.width.mas_offset(120);
}];
[self.redesignLabe mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.begindateButton.mas_right).mas_offset(10);
make.top.equalTo(self.RecentlydateLabe).mas_offset(2);
make.width.mas_offset(20);
}];
[self.enddateButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.redesignLabe.mas_right).mas_offset(10);
make.top.equalTo(self.RecentlydateLabe).mas_offset(-4);
make.width.mas_offset(120);
}];
//设置按钮时间
[self.begindateButton setTitle:[self dateAsString:[NSDate date]] forState:UIControlStateNormal];
[self.enddateButton setTitle:[self dateAsString:[NSDate date]] forState:UIControlStateNormal];
......@@ -107,34 +85,25 @@
self.begindateButton.layer.cornerRadius = 10;
self.enddateButton.layer.masksToBounds = YES;
self.enddateButton.layer.cornerRadius = 10;
WS(weakSelf);
//下拉刷新
MjRefreshHeaderCustom *headerRefresh = [MjRefreshHeaderCustom headerWithRefreshingBlock:^{
DataPage *page = [[DataPage alloc]init];
page.page = ONE;
page.rows = KROWS;
self.conditionModel.page = page;
[self.allCustomerTableview.mj_footer resetNoMoreData];
//经销商代码
self.conditionModel.resellerCodeEquals = [[Shoppersmanager manager].Shoppers.employee.currentDepart orgCode];
[self getShoppersAssociatedCustomer:self.conditionModel isRemove:YES];
weakSelf.conditionModel.page.page = ONE;
[weakSelf.allCustomerTableview.mj_footer resetNoMoreData];
[weakSelf getShoppersAssociatedCustomer:weakSelf.conditionModel isRemove:YES];
}];
headerRefresh.stateLabel.hidden = YES;
headerRefresh.lastUpdatedTimeLabel.hidden = YES;
self.allCustomerTableview.mj_header = headerRefresh;
[self.allCustomerTableview.mj_header beginRefreshing];
//上拉加载
self.allCustomerTableview.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
if ( ++ self.indexPage > self.totalPages) {
[self.allCustomerTableview.mj_footer endRefreshingWithNoMoreData];
if ( ++ weakSelf.conditionModel.page.page > weakSelf.totalPages) {
[weakSelf.allCustomerTableview.mj_footer endRefreshingWithNoMoreData];
}else
{
DataPage *page = [[DataPage alloc]init];
page.rows = KROWS;
page.page = self.indexPage;
self.conditionModel.page = page;
[self getShoppersAssociatedCustomer:self.conditionModel isRemove:NO];
[weakSelf getShoppersAssociatedCustomer:weakSelf.conditionModel isRemove:NO];
}
}];
self.allCustomerTableview.mj_footer.automaticallyHidden = YES;
......@@ -152,7 +121,7 @@
weakSelf.allCustomerTableview.emptyDataSetSource = weakSelf;
weakSelf.allCustomerTableview.emptyDataSetDelegate = weakSelf;
[XBLoadingView hideHUDViewWithDefault];
[weakSelf endRefreshingForTableView:self.allCustomerTableview];
[weakSelf endRefreshingForTableView:weakSelf.allCustomerTableview];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
if (remove) {
[weakSelf.CustomerresultArray removeAllObjects];
......@@ -176,10 +145,8 @@
myclientModel.picture = objc.picture;
myclientModel.company = objc.company;
myclientModel.lastVisitedTime = objc.lastVisitedTime;
[weakSelf.CustomerresultArray addObject:myclientModel];
}
[weakSelf.allCustomerTableview reloadData];
}
else
......@@ -194,7 +161,6 @@
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
AllCutomerTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"allcustomercell" forIndexPath:indexPath];
......@@ -238,10 +204,10 @@
DateSelectedViewController *datevc = [[DateSelectedViewController alloc]init];
//选中时间回调
WS(weakSelf);
[datevc setSelectedDateBlock:^(NSDate *selectedDate) {
[self.begindateButton setTitle:[self dateAsString:selectedDate] forState:UIControlStateNormal];
[self CalltimeSearch];
[weakSelf.begindateButton setTitle:[weakSelf dateAsString:selectedDate] forState:UIControlStateNormal];
[weakSelf CalltimeSearch];
}];
datevc.preferredContentSize = CGSizeMake(300, 250);
......@@ -262,19 +228,16 @@
[formatter setDateFormat:@"yyyy-MM-dd"];
NSString * timeString = [formatter stringFromDate:date];
return timeString;
}
#pragma mark -结束筛选时间
- (IBAction)EndScreeningButtonClick:(UIButton *)sender {
WS(weakSelf);
DateSelectedViewController *datevc = [[DateSelectedViewController alloc]init];
//选中时间回调
[datevc setSelectedDateBlock:^(NSDate *selectedDate) {
[self.enddateButton setTitle:[self dateAsString:selectedDate] forState:UIControlStateNormal];
[self CalltimeSearch];
[weakSelf.enddateButton setTitle:[weakSelf dateAsString:selectedDate] forState:UIControlStateNormal];
[weakSelf CalltimeSearch];
}];
datevc.preferredContentSize = CGSizeMake(300, 250);
......
......@@ -41,6 +41,12 @@
*/
@property (nonatomic,strong) NSArray<PrizeListModel *>*selectArray;
/**
申请完成
*/
@property (nonatomic,copy) void(^requestFinishBlock)();
@end
......@@ -63,7 +63,7 @@
for (int i=0; i<_selectArray.count; i++) {
PrizeListModel *model = _selectArray[i];
UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(i*width+i*interval, 0, width, width)];
[imageView sd_setImageWithURL:[NSURL URLWithString:model.picture] placeholderImage:REPLACEIMAGE];
[imageView sd_setImageWithURL:[NSURL URLWithString:model.attachment.fileUrl] placeholderImage:REPLACEIMAGE];
[self.exchangeScrollView addSubview:imageView];
}
self.exchangeScrollView.contentSize = CGSizeMake(width*_selectArray.count+interval*_selectArray.count-1, 0);
......@@ -115,6 +115,9 @@
if ([[self class] isBlankString:self.mobileTextField.text]) {
[XBLoadingView showHUDViewWithText:@"联系电话不能为空"];return;
}
if (![HENLENSONG isValidateMobile:self.mobileTextField.text]) {
[XBLoadingView showHUDViewWithText:@"手机号码格式不正确"];return;
}
if ([[self class] isBlankString:self.addressButton.currentTitle]) {
[XBLoadingView showHUDViewWithText:@"地址不能为空"];return;
}
......@@ -134,6 +137,9 @@
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[XBLoadingView showHUDViewWithSuccessText:@"申请成功" completeBlock:^{
if (weakSelf.requestFinishBlock) {
weakSelf.requestFinishBlock();
}
[weakSelf dismissViewControllerAnimated:YES completion:nil];
}];
......
......@@ -46,12 +46,26 @@
CardBeenUseViewController *usedVc = [[[self class] getMainStoryboardClass] instantiateViewControllerWithIdentifier:@"CardBeenUseViewController"];
usedVc.cardState = USED;
[self addChildViewController:usedVc];
[self.cardBackgroundView addSubview:dontUseVc.view];
self.currentVC = dontUseVc;
}
#pragma mark - 布局
- (void)viewDidLayoutSubviews
{
CardDontUseViewController *dontUseVc = self.childViewControllers[0];
dontUseVc.view.frame = CGRectMake(0, 0, self.cardBackgroundView.mj_w, self.cardBackgroundView.mj_h);
CardBeenUseViewController *beenUseVc = self.childViewControllers[1];
beenUseVc.view.frame = CGRectMake(0, 0, self.cardBackgroundView.mj_w, self.cardBackgroundView.mj_h);
CardBeenUseViewController *examineUseVc = self.childViewControllers[2];
examineUseVc.view.frame = CGRectMake(0, 0, self.cardBackgroundView.mj_w, self.cardBackgroundView.mj_h);
CardBeenUseViewController *usedVc = self.childViewControllers[3];
usedVc.view.frame = CGRectMake(0, 0, self.cardBackgroundView.mj_w, self.cardBackgroundView.mj_h);
[self.cardBackgroundView addSubview:dontUseVc.view];
self.currentVC = dontUseVc;
self.instructionsLineView.frame = CGRectMake(self.dontUseButton.x, self.dontUseButton.bottom, self.dontUseButton.width, 2);
}
......@@ -88,7 +102,7 @@
{
self.dontUseButton.selected = NO;
self.beenUseButton.selected = NO;
self.examinationButton.selected = NO;
self.isUsedButton.selected = NO;
}
break;
case 103:
......@@ -111,7 +125,7 @@
- (void)setupInstructionsViewOrigin:(UIButton *)sender
{
[UIView animateWithDuration:0.5 delay:0.1f usingSpringWithDamping:0.5f initialSpringVelocity:0.5f options:UIViewAnimationOptionCurveEaseInOut animations:^{
self.instructionsLineView.frame = CGRectMake(sender.mj_origin.x+(sender.mj_w-self.instructionsLineView.mj_w)/2, self.instructionsLineView.mj_origin.y, self.instructionsLineView.mj_w, 2);
self.instructionsLineView.frame = CGRectMake(sender.x, sender.bottom, sender.width, 2);
} completion:nil];
}
......
......@@ -61,11 +61,13 @@
- (void)getCardDatasAction
{
WS(weakSelf);
[XBLoadingView showHUDViewWithDefaultWithView:self.view];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(QUERYALLJDECARD) WithRequestType:ZERO WithParameter:self.requestModel WithReturnValueBlock:^(id returnValue) {
weakSelf.cardCollectionView.emptyDataSetSource = weakSelf;
weakSelf.cardCollectionView.emptyDataSetDelegate = weakSelf;
[weakSelf endRefreshingForTableView:weakSelf.cardCollectionView];
[XBLoadingView hideHUDViewWithDefaultWithView:weakSelf.view];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weakSelf.datasArray removeAllObjects];
......@@ -79,6 +81,8 @@
}
}WithFailureBlock:^(NSError *error) {
[XBLoadingView hideHUDViewWithDefaultWithView:weakSelf.view];
[weakSelf endRefreshingForTableView:weakSelf.cardCollectionView];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......@@ -87,16 +91,17 @@
- (void)useJDECard:(NSString *)JDECardNumber
{
WS(weakSelf);
[XBLoadingView showHUDViewWithDefault];
[XBLoadingView showHUDViewWithDefaultWithView:self.view];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(USEJDECARD),JDECardNumber] WithRequestType:ZERO WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[XBLoadingView hideHUDViewWithDefault];
[XBLoadingView hideHUDViewWithDefaultWithView:weakSelf.view];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weakSelf deleteUsedJDECard:JDECardNumber];
}else{
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
}WithFailureBlock:^(NSError *error) {
[XBLoadingView hideHUDViewWithDefaultWithView:weakSelf.view];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......
......@@ -75,12 +75,17 @@
[self addChildViewController:self.shoppingCar];
self.currentVC = self.shoppingCar;
[self.controllerBackgroundView addSubview:self.shoppingCar.view];
self.currentVC.view.frame = CGRectMake(0, 176, ScreenWidth-40, self.controllerBackgroundView.height-176);
self.orderRecord = [[[self class] getMainStoryboardClass] instantiateViewControllerWithIdentifier:@"OrderRecordViewController"];
[self addChildViewController:self.orderRecord];
self.orderRecord.model = self.model;
self.orderRecord.view.frame = CGRectMake(0, 176, ScreenWidth-40, self.controllerBackgroundView.height-176);
}
#pragma mark - 设置frame
- (void)viewDidLayoutSubviews
{
self.currentVC.view.frame = CGRectMake(0, self.shoppingAndRecordBackview.bottom, self.controllerBackgroundView.width, self.controllerBackgroundView.height-self.shoppingAndRecordBackview.bottom);
self.orderRecord.view.frame = CGRectMake(0, self.shoppingAndRecordBackview.bottom, self.controllerBackgroundView.width, self.controllerBackgroundView.height-self.shoppingAndRecordBackview.bottom);
}
#pragma mark - 切换子视图
......
......@@ -16,11 +16,6 @@
*/
@property (nonatomic,strong) NSMutableArray *datasArray;
/**
* 当前页数
*/
@property (nonatomic,assign) int indexPage;
/**
* 订单状态数组
*/
......@@ -64,6 +59,10 @@
{
if (!_model) {
_model = [[OrderFilter alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = ONE;
page.rows = KROWS;
_model.dp = page;
}
return _model;
}
......@@ -117,11 +116,6 @@
WS(weakSelf);
MjRefreshHeaderCustom *headerRefresh = [MjRefreshHeaderCustom headerWithRefreshingBlock:^{
weakSelf.indexPage = ONE;
DataPage *page = [[DataPage alloc]init];
page.page = weakSelf.indexPage;
page.rows = KROWS;
weakSelf.model.dp = page;
[weakSelf.customerOrderTableView.mj_footer resetNoMoreData];
[weakSelf getGuideAllcustomerOrder:YES WithorderBill:weakSelf.model];
}];
......@@ -132,14 +126,10 @@
//上拉加载
self.customerOrderTableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
if ( ++ weakSelf.indexPage > weakSelf.totalPages) {
if ( ++ weakSelf.model.dp.page > weakSelf.totalPages) {
[weakSelf.customerOrderTableView.mj_footer endRefreshingWithNoMoreData];
}else
{
DataPage *page = [[DataPage alloc]init];
page.page = weakSelf.indexPage;
page.rows = KROWS;
weakSelf.model.dp = page;
[weakSelf getGuideAllcustomerOrder:NO WithorderBill:weakSelf.model];
}
}];
......
......@@ -40,7 +40,7 @@
self.integralDetailsTableView.rowHeight = (self.cellType == PrizeTableView)?90:70;
self.integralDetailsTableView.tableFooterView = [UIView new];
if (self.cellType == PrizeTableView) {
self.topConstraint.constant = 64;
self.topConstraint.constant = 24;
self.integralDetailsTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.integralDetailsTableView.backgroundColor = RGB(237, 238, 239, 1);
}
......
......@@ -251,24 +251,14 @@
//默认加载全部数据
productVC.barcode = nil;
productVC.selectedCode = nil;
productVC.condtionModel.categoryEquals = nil;
productVC.condtionModel.styleEquals = nil;
productVC.condtionModel.spaceEquals = nil;
productVC.condtionModel.materialEqueals = nil;
productVC.condtionModel.startprice = nil;
productVC.condtionModel.endprice = nil;
productVC.condtionModel.nameLike = nil;
productVC.condtionModel = nil;
[productVC.productCollectionView.mj_header beginRefreshing];
}else if ([Name isEqualToString:@"所有客户"])
{
selectedIndex = 8;
AllCustomerViewController *AllcustomerVC = [SHARED_APPDELEGATE.allControllerArray objectAtIndex_opple:8];
AllcustomerVC.searchTextfield.text = nil;
AllcustomerVC.conditionModel.resellerCodeEquals = nil;
AllcustomerVC.conditionModel.mobileEquals = nil;
AllcustomerVC.conditionModel.createTimeBegin = nil;
AllcustomerVC.conditionModel.createTimeEnd = nil;
AllcustomerVC.conditionModel.page = nil;
AllcustomerVC.conditionModel = nil;
[AllcustomerVC.allCustomerTableview.mj_header beginRefreshing];
}else if ([Name isEqualToString:@"客户订单"])
{
......
......@@ -127,13 +127,13 @@
- (void)getDrawDatas:(BOOL)isRemove
{
WS(weakSelf);
[XBLoadingView showHUDViewWithDefault];
[XBLoadingView showHUDViewWithDefaultWithView:self.view];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(LOTTERYED) WithRequestType:ZERO WithParameter:self.drawModel WithReturnValueBlock:^(id returnValue) {
[weakSelf endRefreshingForTableView:weakSelf.drawDetailsTableView];
weakSelf.drawDetailsTableView.emptyDataSetSource = weakSelf;
weakSelf.drawDetailsTableView.emptyDataSetDelegate = weakSelf;
[XBLoadingView hideHUDViewWithDefault];
[XBLoadingView hideHUDViewWithDefaultWithView:weakSelf.view];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
if (isRemove) {
[weakSelf.datasArray removeAllObjects];
......@@ -146,6 +146,8 @@
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.drawDetailsTableView];
[XBLoadingView hideHUDViewWithDefaultWithView:weakSelf.view];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......@@ -162,16 +164,6 @@
cell.orderNumberTitle.font = [UIFont systemFontOfSize:12];
cell.drawButton.titleLabel.font = [UIFont systemFontOfSize:12];
cell.orderNumberLabel.font = [UIFont systemFontOfSize:12];
[cell.drawButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(cell).offset(-20);
make.size.mas_equalTo(CGSizeMake(50, 20));
make.centerY.equalTo(cell);
}];
[cell.orderNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(cell.orderNumberTitle.mas_right).offset(-10);
make.centerY.equalTo(cell.orderNumberTitle);
make.right.equalTo(cell).offset(-100);
}];
}
return cell;
}
......@@ -185,11 +177,6 @@
cell.orderNumberTitle.font = [UIFont systemFontOfSize:12];
cell.trophyLabel.font = [UIFont systemFontOfSize:12];
cell.orderNumber.font = [UIFont systemFontOfSize:12];
[cell.orderNumber mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(cell.orderNumberTitle.mas_right).offset(-10);
make.centerY.equalTo(cell.orderNumberTitle);
make.right.equalTo(cell).offset(-100);
}];
}
return cell;
}
......
......@@ -31,17 +31,25 @@
[self addChildViewController:notDrawControl];
notDrawControl.drawValue = 1;
self.currentVC = notDrawControl;
/// 已抽奖
LuckyDrawDetailsViewController *usedDrawControl = [[[self class] getMainStoryboardClass] instantiateViewControllerWithIdentifier:@"LuckyDrawDetailsViewController"];
usedDrawControl.drawValue = 2;
[self addChildViewController:usedDrawControl];
[self.backGroundView addSubview:notDrawControl.view];
}
#pragma mark - 布局
- (void)viewDidLayoutSubviews
{
LuckyDrawDetailsViewController *notDrawControl = self.childViewControllers[0];
notDrawControl.view.frame = CGRectMake(0, 0, self.backGroundView.mj_w, self.backGroundView.mj_h);
LuckyDrawDetailsViewController *usedDrawControl = self.childViewControllers[1];
usedDrawControl.view.frame = CGRectMake(0, 0, self.backGroundView.mj_w, self.backGroundView.mj_h);
[self.backGroundView addSubview:notDrawControl.view];
self.indicateLineView.frame = CGRectMake(self.notDrawButton.x, self.notDrawButton.bottom, self.notDrawButton.width, 2);
}
#pragma mark - 切换未抽奖和已抽奖
- (void)switchPaymentsVCAndWithdrawalVC:(UIViewController *)newViewController
{
......@@ -81,7 +89,8 @@
- (void)setupInstructionsViewOrigin:(UIButton *)sender
{
[UIView animateWithDuration:0.5 delay:0.1f usingSpringWithDamping:0.5f initialSpringVelocity:0.5f options:UIViewAnimationOptionCurveEaseInOut animations:^{
self.indicateLineView.frame = CGRectMake(sender.mj_origin.x+(sender.mj_w-self.indicateLineView.mj_w)/2, self.indicateLineView.mj_origin.y, self.indicateLineView.mj_w, 2);
self.indicateLineView.frame = CGRectMake(sender.x, sender.bottom, sender.width, 2);
} completion:nil];
}
......
......@@ -97,11 +97,13 @@
- (void)getDatasAction:(BOOL)isRemoveAll
{
WS(weakSelf);
[XBLoadingView showHUDViewWithDefaultWithView:self.view];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(PAYMENTS) WithRequestType:ZERO WithParameter:self.model WithReturnValueBlock:^(id returnValue) {
weakSelf.paymentsTableView.emptyDataSetSource = self;
weakSelf.paymentsTableView.emptyDataSetDelegate = self;
weakSelf.paymentsTableView.emptyDataSetSource = weakSelf;
weakSelf.paymentsTableView.emptyDataSetDelegate = weakSelf;
[weakSelf endRefreshingForTableView:weakSelf.paymentsTableView];
[XBLoadingView hideHUDViewWithDefaultWithView:weakSelf.view];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
if (isRemoveAll) {
[weakSelf.resultArray removeAllObjects];
......@@ -119,6 +121,7 @@
}WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.paymentsTableView];
[XBLoadingView hideHUDViewWithDefaultWithView:weakSelf.view];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......
......@@ -13,19 +13,10 @@
- (void)setPrizeModel:(PrizeListModel *)prizeModel
{
_prizeModel = prizeModel;
[self.prizeImageView sd_setImageWithURL:[NSURL URLWithString:_prizeModel.picture] placeholderImage:REPLACEIMAGE];
[self.prizeImageView sd_setImageWithURL:[NSURL URLWithString:_prizeModel.attachment.fileUrl] placeholderImage:REPLACEIMAGE];
self.prizeDescribeLabel.text = _prizeModel.name;
self.isSelectButton.selected = _prizeModel.isSelect;
self.backgroundColor = _prizeModel.isAllowSelect?[UIColor whiteColor]:[UIColor lightGrayColor];
}
#pragma mark - 选中
- (IBAction)isSelectButton:(UIButton *)sender {
if (_prizeModel.isAllowSelect) {
sender.selected = !sender.selected;
_prizeModel.isSelect = sender.selected;
}
}
@end
......@@ -18,9 +18,5 @@
*/
@property (nonatomic,assign) BOOL isSelect;
/**
是否允许选中
*/
@property (nonatomic,assign) BOOL isAllowSelect;
@end
......@@ -24,6 +24,7 @@
self.name = model.name;
self.createDate = model.createDate;
self.updateDate = model.updateDate;
self.attachment = model.attachment;
self.isSelect = NO;
}
return self;
......
......@@ -26,14 +26,15 @@
@property (nonatomic,strong) NSMutableArray *prizeDatasArray;
/**
可以申请的列表
总页数
*/
@property (nonatomic,strong) NSMutableArray *availableArray;
@property (nonatomic,assign) NSInteger totalPage;
/**
总页数
是否有兑换资格
*/
@property (nonatomic,assign) NSInteger totalPage;
@property (nonatomic,assign) NSInteger isQualified;
@end
@implementation PrizeMainViewController
......@@ -110,16 +111,13 @@
dispatch_group_leave(group);
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
//任务二 查询可申请礼品
//任务二 查询是否有兑换资格
dispatch_group_enter(group);
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(EXCHANGEQUALIFICATION),[Shoppersmanager manager].Shoppers.employee.fid] WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
dispatch_group_leave(group);
if ([returnValue[@"code"] isEqualToNumber:@0]) {
if (isRemove) {
[weakSelf.availableArray removeAllObjects];
}
[weakSelf.availableArray addObjectsFromArray:returnValue[@"data"]];
weakSelf.isQualified = [returnValue[@"data"] integerValue];
}else {
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
......@@ -131,11 +129,6 @@
// 所有请求完成后
dispatch_group_notify(group, dispatch_get_main_queue(), ^{
for (PrizeListModel *model in weakSelf.prizeDatasArray) {
if ([weakSelf.availableArray containsObject:model.fid]) {
model.isAllowSelect = YES;
}
}
[XBLoadingView hideHUDViewWithDefault];
[weakSelf endRefreshingForTableView:weakSelf.prizeListCollectionView];
[weakSelf.prizeListCollectionView reloadData];
......@@ -158,12 +151,19 @@
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
if (self.isQualified) {
PrizeListCollectionViewCell *cell = (PrizeListCollectionViewCell *)[collectionView cellForItemAtIndexPath:indexPath];
for (PrizeListModel *model in self.prizeDatasArray) {
model.isSelect = NO;
}
for (PrizeListCollectionViewCell *cell in self.prizeListCollectionView.visibleCells) {
cell.isSelectButton.selected = NO;
}
PrizeListModel *model = self.prizeDatasArray[indexPath.item];
cell.isSelectButton.selected = YES;
model.isSelect = cell.isSelectButton.selected;
if (model.isAllowSelect) {
cell.isSelectButton.selected = !cell.isSelectButton.selected;
model.isSelect = cell.isSelectButton.selected;
}else {
[XBLoadingView showHUDViewWithText:@"没有兑换资格"];
}
}
......@@ -180,6 +180,10 @@
[XBLoadingView showHUDViewWithText:@"未选中任何礼品"];return;
}
ApplyPrizeViewController *applyPrizeVC = [[ApplyPrizeViewController alloc]init];
WS(weakSelf);
[applyPrizeVC setRequestFinishBlock:^{
[weakSelf.prizeListCollectionView.mj_header beginRefreshing];
}];
applyPrizeVC.preferredContentSize = applyPrizeVC.view.mj_size;
applyPrizeVC.selectArray = selectArray;
applyPrizeVC.modalPresentationStyle = UIModalPresentationFormSheet;
......@@ -235,12 +239,5 @@
return _queryPrizeModel;
}
- (NSMutableArray *)availableArray
{
if (!_availableArray) {
_availableArray = [NSMutableArray array];
}
return _availableArray;
}
@end
......@@ -129,23 +129,35 @@
WithdrawalViewController *withdrawal = [[[self class] getMainStoryboardClass] instantiateViewControllerWithIdentifier:@"WithdrawalViewController"];
[self addChildViewController:withdrawal];
payments.view.frame = CGRectMake(0, 40, self.contentBackgroundView.mj_w, self.contentBackgroundView.mj_h-40);
withdrawal.view.frame = CGRectMake(0, 40, self.contentBackgroundView.mj_w, self.contentBackgroundView.mj_h-40);
[self.contentBackgroundView addSubview:payments.view];
self.currentVC = payments;
/// 我的卡劵
CardViewController *cardVc = [[[self class] getMainStoryboardClass] instantiateViewControllerWithIdentifier:@"CardViewController"];
[self addChildViewController:cardVc];
cardVc.view.frame = CGRectMake(0, 40, self.cardBackgroundView.mj_w, self.cardBackgroundView.mj_h-50);
[self.cardBackgroundView addSubview:cardVc.view];
// /// 我的抽奖
// LuckyDrawDetailsViewController *draw = [[[self class] getMainStoryboardClass] instantiateViewControllerWithIdentifier:@"LuckyDrawDetailsViewController"];
// [self addChildViewController:draw];
// draw.drawValue = 0;
// draw.view.frame = CGRectMake(0, 40, self.drawBackgroundView.mj_w, self.drawBackgroundView.mj_h-50);
// [self.drawBackgroundView addSubview:draw.view];
/// 我的抽奖
LuckyDrawDetailsViewController *draw = [[[self class] getMainStoryboardClass] instantiateViewControllerWithIdentifier:@"LuckyDrawDetailsViewController"];
[self addChildViewController:draw];
draw.drawValue = 0;
[self.drawBackgroundView addSubview:draw.view];
}
#pragma mark - 调整布局
- (void)viewDidLayoutSubviews
{
PaymentsViewController *payments = self.childViewControllers[0];
payments.view.frame = CGRectMake(0, 40, self.contentBackgroundView.mj_w, self.contentBackgroundView.mj_h-40);
WithdrawalViewController *withDrawal = self.childViewControllers[1];
withDrawal.view.frame = CGRectMake(0, 40, self.contentBackgroundView.mj_w, self.contentBackgroundView.mj_h-40);
CardViewController *cardVc = self.childViewControllers[2];
cardVc.view.frame = CGRectMake(0, 40, self.cardBackgroundView.mj_w, self.cardBackgroundView.mj_h-50);
LuckyDrawDetailsViewController *draw = self.childViewControllers[3];
draw.view.frame = CGRectMake(0, 40, self.drawBackgroundView.mj_w, self.drawBackgroundView.mj_h-50);
}
......
......@@ -97,11 +97,13 @@
- (void)getDatasAction:(BOOL)isRemoveAll
{
WS(weakSelf);
[XBLoadingView showHUDViewWithDefaultWithView:self.view];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(WITHDRAWALPROGRESS) WithRequestType:ZERO WithParameter:self.model WithReturnValueBlock:^(id returnValue) {
weakSelf.withdrawalTableView.emptyDataSetSource = self;
weakSelf.withdrawalTableView.emptyDataSetDelegate = self;
weakSelf.withdrawalTableView.emptyDataSetSource = weakSelf;
weakSelf.withdrawalTableView.emptyDataSetDelegate = weakSelf;
[weakSelf endRefreshingForTableView:weakSelf.withdrawalTableView];
[XBLoadingView hideHUDViewWithDefaultWithView:weakSelf.view];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
if (isRemoveAll) {
[weakSelf.resultArray removeAllObjects];
......@@ -118,6 +120,7 @@
}
}WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.withdrawalTableView];
[XBLoadingView hideHUDViewWithDefaultWithView:weakSelf.view];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......
......@@ -192,7 +192,7 @@
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="9kC-nV-7qm">
<button opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="9kC-nV-7qm">
<constraints>
<constraint firstAttribute="height" constant="20" id="o3S-8T-gOV"/>
<constraint firstAttribute="width" constant="20" id="vcE-w6-Bg9"/>
......@@ -521,7 +521,7 @@
<constraints>
<constraint firstItem="jVO-nq-vjx" firstAttribute="top" secondItem="6OB-63-x5H" secondAttribute="bottom" id="9sj-tZ-6wH"/>
<constraint firstItem="6OB-63-x5H" firstAttribute="leading" secondItem="gPk-r6-eLE" secondAttribute="leading" id="Bsy-q4-bho"/>
<constraint firstItem="6OB-63-x5H" firstAttribute="top" secondItem="7GR-0c-ewm" secondAttribute="bottom" constant="44" id="xxF-NK-Nxl"/>
<constraint firstItem="6OB-63-x5H" firstAttribute="top" secondItem="7GR-0c-ewm" secondAttribute="bottom" constant="24" id="xxF-NK-Nxl"/>
<constraint firstAttribute="trailing" secondItem="6OB-63-x5H" secondAttribute="trailing" id="z27-GL-bif"/>
</constraints>
</view>
......@@ -549,10 +549,10 @@
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="IntegralDetailsTableViewCell" rowHeight="70" id="dvh-wm-f5G" customClass="IntegralDetailsTableViewCell">
<rect key="frame" x="0.0" y="28" width="1023" height="70"/>
<rect key="frame" x="0.0" y="28" width="1024" height="70"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="dvh-wm-f5G" id="UeK-sH-3z8">
<frame key="frameInset" width="1023" height="69"/>
<frame key="frameInset" width="1024" height="69"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="积分清零" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YDf-Lj-2uh">
......@@ -587,10 +587,10 @@
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="prizeDetailsTableViewCell" rowHeight="90" id="GX2-Gv-YRn" customClass="prizeDetailsTableViewCell">
<rect key="frame" x="0.0" y="98" width="1023" height="90"/>
<rect key="frame" x="0.0" y="98" width="1024" height="90"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="GX2-Gv-YRn" id="tQ9-m3-04b">
<frame key="frameInset" width="1023" height="89"/>
<frame key="frameInset" width="1024" height="89"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Zvz-7f-MPc">
......
......@@ -228,7 +228,7 @@
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="90" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="Ogf-Th-qTY">
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="ForumTableViewCell" rowHeight="90" id="gz9-gD-P6A" customClass="ForumTableViewCell">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" misplaced="YES" selectionStyle="none" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="ForumTableViewCell" rowHeight="90" id="gz9-gD-P6A" customClass="ForumTableViewCell">
<rect key="frame" x="0.0" y="28" width="768" height="90"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="gz9-gD-P6A" id="4lI-td-FE0">
......@@ -1230,7 +1230,7 @@ timingFunction 设置动画速度曲线,默认值上面已经给出.下面说它
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="70" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="lXY-sE-fW1">
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="VideoDetailIntroTableViewCell" rowHeight="100" id="Qnm-0r-wEL" customClass="VideoDetailIntroTableViewCell">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" misplaced="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="VideoDetailIntroTableViewCell" rowHeight="100" id="Qnm-0r-wEL" customClass="VideoDetailIntroTableViewCell">
<rect key="frame" x="0.0" y="28" width="768" height="100"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Qnm-0r-wEL" id="VAA-bT-OlF">
......@@ -1261,7 +1261,7 @@ timingFunction 设置动画速度曲线,默认值上面已经给出.下面说它
<outlet property="studyIntroDetailTitleLabel" destination="pIM-cg-VXA" id="qhO-cv-4Hn"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="VideoLecturerTableViewCell" rowHeight="130" id="WzB-nZ-wsW" customClass="VideoLecturerTableViewCell">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" misplaced="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="VideoLecturerTableViewCell" rowHeight="130" id="WzB-nZ-wsW" customClass="VideoLecturerTableViewCell">
<rect key="frame" x="0.0" y="128" width="768" height="130"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="WzB-nZ-wsW" id="Zzv-Yi-ZxT">
......@@ -1315,7 +1315,7 @@ timingFunction 设置动画速度曲线,默认值上面已经给出.下面说它
<outlet property="lecurerIntroLabel" destination="85S-CZ-3Vl" id="LLr-eD-OYY"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="SpecifiedTableViewCell" rowHeight="100" id="oia-jO-L9n" customClass="SpecifiedTableViewCell">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" misplaced="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="SpecifiedTableViewCell" rowHeight="100" id="oia-jO-L9n" customClass="SpecifiedTableViewCell">
<rect key="frame" x="0.0" y="258" width="768" height="100"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="oia-jO-L9n" id="AMF-ag-ZWN">
......@@ -1693,7 +1693,7 @@ timingFunction 设置动画速度曲线,默认值上面已经给出.下面说它
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="none" rowHeight="81" sectionHeaderHeight="18" sectionFooterHeight="18" translatesAutoresizingMaskIntoConstraints="NO" id="XRP-My-vMh">
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="AssessmentHeaderView" rowHeight="60" id="2M5-To-MLj" customClass="AssessmentHeaderView">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" misplaced="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="AssessmentHeaderView" rowHeight="60" id="2M5-To-MLj" customClass="AssessmentHeaderView">
<rect key="frame" x="0.0" y="56" width="768" height="60"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="2M5-To-MLj" id="ypf-GL-4CP">
......@@ -1718,7 +1718,7 @@ timingFunction 设置动画速度曲线,默认值上面已经给出.下面说它
<outlet property="titleLabel" destination="RBj-Qh-HCD" id="uH0-fJ-SI2"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="AssessmentTableViewCell" rowHeight="50" id="BjI-a1-CRm" customClass="AssessmentTableViewCell">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" misplaced="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="AssessmentTableViewCell" rowHeight="50" id="BjI-a1-CRm" customClass="AssessmentTableViewCell">
<rect key="frame" x="0.0" y="116" width="768" height="50"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="BjI-a1-CRm" id="bq8-ly-DcD">
......
This diff is collapsed.
......@@ -59,7 +59,7 @@
[super viewDidLoad];
self.automaticallyAdjustsScrollViewInsets = NO;
self.navigationController.navigationBarHidden = YES;
self.navigationController.navigationBar.translucent = NO;
//检测登陆超时通知
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(logintimeoutNotification:) name:LOGINTIMEOUT object:nil];
}
......
......@@ -16,6 +16,11 @@
*/
+ (void)showHUDViewWithDefault;
/**
显示普通加载框
*/
+ (void)showHUDViewWithDefaultWithView:(UIView *)view;
/**
显示文本提示框
......@@ -44,7 +49,10 @@
*/
+ (void)hideHUDViewWithDefault;
/**
隐藏加载框
*/
+ (void)hideHUDViewWithDefaultWithView:(UIView *)view;
......
......@@ -15,7 +15,20 @@
*/
+ (void)showHUDViewWithDefault
{
XBLoadingView *hud = [XBLoadingView showHUDAddedTo:SHARED_APPDELEGATE.window animated:YES];
XBLoadingView *hud = [XBLoadingView showHUDAddedTo:[self hudShowWindow] animated:YES];
hud.animationType = MBProgressHUDAnimationZoom;
hud.mode = MBProgressHUDModeIndeterminate;
hud.color = [UIColor clearColor];
hud.activityIndicatorColor = kMainBlueColor;
hud.removeFromSuperViewOnHide = YES;
}
/**
显示普通加载框
*/
+ (void)showHUDViewWithDefaultWithView:(UIView *)view
{
XBLoadingView *hud = [XBLoadingView showHUDAddedTo:view animated:YES];
hud.animationType = MBProgressHUDAnimationZoom;
hud.mode = MBProgressHUDModeIndeterminate;
hud.color = [UIColor clearColor];
......@@ -30,8 +43,7 @@
*/
+ (void)showHUDViewWithText:(NSString *)text
{
[[self class] hideHUDViewWithDefault];
XBLoadingView *hud = [XBLoadingView showHUDAddedTo:SHARED_APPDELEGATE.window animated:YES];
XBLoadingView *hud = [XBLoadingView showHUDAddedTo:[self hudShowWindow] animated:YES];
hud.labelText = text;
hud.margin = 20.f;
hud.color = [[UIColor blackColor] colorWithAlphaComponent:0.5];
......@@ -48,7 +60,7 @@
*/
+ (void)showHUDViewWithSuccessText:(NSString *)text completeBlock:(void (^)())finish
{
XBLoadingView *hud = [XBLoadingView showHUDAddedTo:SHARED_APPDELEGATE.window animated:YES];
XBLoadingView *hud = [XBLoadingView showHUDAddedTo:[self hudShowWindow] animated:YES];
hud.mode = MBProgressHUDModeCustomView;
UIImage *image = [[UIImage imageNamed:@"success-1"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
hud.customView = [[UIImageView alloc] initWithImage:image];
......@@ -72,7 +84,7 @@
*/
+ (XBLoadingView *)showHUDViewProgressLabel:(NSString *)text
{
XBLoadingView *hud = [XBLoadingView showHUDAddedTo:SHARED_APPDELEGATE.window animated:YES];
XBLoadingView *hud = [XBLoadingView showHUDAddedTo:[self hudShowWindow] animated:YES];
hud.mode = MBProgressHUDModeDeterminateHorizontalBar;
hud.labelText = text;
hud.labelFont = [UIFont systemFontOfSize:12];
......@@ -85,7 +97,30 @@
*/
+ (void)hideHUDViewWithDefault
{
[[self class] hideHUDForView:SHARED_APPDELEGATE.window animated:YES];
[[self class] hideAllHUDsForView:[self hudShowWindow] animated:YES];
}
/**
隐藏加载框
*/
+ (void)hideHUDViewWithDefaultWithView:(UIView *)view
{
[[self class] hideAllHUDsForView:view animated:YES];
}
+ (UIWindow *)hudShowWindow
{
UIWindow *showWindow = nil;
NSArray *windows = [[UIApplication sharedApplication] windows];
if ([windows count] >= 2) {
showWindow = [windows objectAtIndex:1];
}
else {
showWindow = [[UIApplication sharedApplication] keyWindow];
}
return showWindow;
}
@end
......@@ -157,7 +157,7 @@
/**
* 服务器开发地址
*/
//#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://139.196.195.30:8090/opple-web/app%@",URL]
#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://139.196.195.30:8090/opple-web/app%@",URL]
/**
......@@ -168,7 +168,7 @@
//**
// * 服务器正式地址
// */
#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg.opple.com/opple-web/app%@",URL]
//#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg.opple.com/opple-web/app%@",URL]
/**
* 搜索框输入通知
......
......@@ -28,10 +28,6 @@
*/
@property (nonatomic,strong) NSMutableArray *productDatasArray;
/**
* 当前页数
*/
@property (nonatomic,assign) int indexPage;
/**
* 总页数
......@@ -118,8 +114,11 @@
- (SceneCondition *)conditionModel
{
if (!_conditionModel) {
_conditionModel = [[SceneCondition alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = ONE;
page.rows = KROWS;
_conditionModel.page = page;
}
return _conditionModel;
}
......@@ -129,6 +128,10 @@
{
if (!_goodsModel) {
_goodsModel = [[GoodsCondition alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = ONE;
page.rows = KROWS;
_goodsModel.page = page;
}
return _goodsModel;
}
......@@ -167,11 +170,9 @@
self.isScene = [[NSUserDefaults standardUserDefaults] boolForKey:@"SCENE"];
[self UiConfigAction];
[self ReturnDismiss];
if (self.isScene) {
//场景
[self getDatasAction];
}else
{
//产品
......@@ -182,7 +183,6 @@
#pragma mark -UI
- (void)UiConfigAction
{
self.styleButton.layer.masksToBounds = YES;
self.styleButton.layer.cornerRadius = kSelectedCornerRadius;
self.typeButton.layer.masksToBounds = YES;
......@@ -195,7 +195,7 @@
self.priceButton.layer.cornerRadius = kSelectedCornerRadius;
self.styleButton.selected = YES;
self.styleButton.backgroundColor = kMainBlueColor;
self.rightSelectedIndex = 0;
self.rightSelectedIndex = ZERO;
self.searchProductField.delegate = self;
//筛选Tableview
......@@ -210,7 +210,13 @@
self.myTableViewBackView.layer.shadowRadius = 4;
self.myTableViewBackView.layer.shadowOpacity = 0.5;
self.myTableViewBackView.layer.masksToBounds = NO;
self.sceneOrProductClollectionView.dataSource = self;
self.sceneOrProductClollectionView.delegate = self;
}
#pragma mark - 布局完成
- (void)viewDidLayoutSubviews
{
//数据列表UICollectionView
if (self.isScene) {
self.collectionViewLayout.itemSize = CGSizeMake((self.sceneOrProductClollectionView.mj_w-40)/3, (self.sceneOrProductClollectionView.mj_w-40)/4);
......@@ -224,11 +230,8 @@
self.collectionViewLayout.minimumInteritemSpacing = 10;
self.collectionViewLayout.sectionInset = UIEdgeInsetsMake(10, 10, 10, 10);
}
self.sceneOrProductClollectionView.dataSource = self;
self.sceneOrProductClollectionView.delegate = self;
}
#pragma mark -场景数据
- (void)getDatasAction
{
......@@ -237,7 +240,6 @@
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(SCENESCREENING) WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) {
SceneFilter *filterModel = [[SceneFilter alloc]initWithDictionary:returnValue[@"data"] error:nil];
//风格
NSMutableArray *styleArray = [NSMutableArray array];
......@@ -271,11 +273,7 @@
//下拉刷新
MjRefreshHeaderCustom *headerRefresh = [MjRefreshHeaderCustom headerWithRefreshingBlock:^{
//默认数据
weakSelf.indexPage = 1;
DataPage *page = [[DataPage alloc]init];
page.page = weakSelf.indexPage;
page.rows = KROWS;
weakSelf.conditionModel.page = page;
weakSelf.conditionModel.page.page = ONE;
[weakSelf.sceneOrProductClollectionView.mj_footer resetNoMoreData];
[weakSelf getSceneLibrarydatas:weakSelf.conditionModel isRemove:YES];
}];
......@@ -287,16 +285,11 @@
//上拉加载
self.sceneOrProductClollectionView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
if ( ++ weakSelf.indexPage > weakSelf.totalPages) {
if ( ++ weakSelf.conditionModel.page.page > weakSelf.totalPages) {
[weakSelf.sceneOrProductClollectionView.mj_footer endRefreshingWithNoMoreData];
}else
{
//默认数据
DataPage *Newpage = [[DataPage alloc]init];
Newpage.rows = KROWS;
Newpage.page = weakSelf.indexPage;
weakSelf.conditionModel.page = Newpage;
[weakSelf getSceneLibrarydatas:weakSelf.conditionModel isRemove:NO];
}
}];
......@@ -356,17 +349,12 @@
{
[self getScreeningdatasisRemoveArray:YES];
//下拉刷新
__weak typeof(self) weakSelf = self;
WS(weakSelf);
MjRefreshHeaderCustom *headerRefresh = [MjRefreshHeaderCustom headerWithRefreshingBlock:^{
//分页数据
DataPage *Newpage = [[DataPage alloc]init];
Newpage.page = 1;
Newpage.rows = KROWS;
weakSelf.goodsModel.page = Newpage;
weakSelf.indexPage = 1;
weakSelf.goodsModel.page.page = ONE;
[weakSelf.sceneOrProductClollectionView.mj_footer resetNoMoreData];
[weakSelf getGoodsListDatasisRemove:YES Withobject:self.goodsModel];
[weakSelf getGoodsListDatasisRemove:YES Withobject:weakSelf.goodsModel];
}];
headerRefresh.stateLabel.hidden = YES;
headerRefresh.lastUpdatedTimeLabel.hidden = YES;
......@@ -375,28 +363,21 @@
//上拉加载
self.sceneOrProductClollectionView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
if (++ weakSelf.indexPage > weakSelf.totalPages) {
if (++ weakSelf.goodsModel.page.page > weakSelf.totalPages) {
[weakSelf.sceneOrProductClollectionView.mj_footer endRefreshingWithNoMoreData];
}else
{
//分页数据
DataPage *Newpage = [[DataPage alloc]init];
Newpage.rows = KROWS;
Newpage.page = weakSelf.indexPage;
weakSelf.goodsModel.page = Newpage;
[weakSelf getGoodsListDatasisRemove:NO Withobject:weakSelf.goodsModel];
}
}];
self.sceneOrProductClollectionView.mj_footer.automaticallyHidden = YES;
}
#pragma mark -获取产品筛选数据
- (void)getScreeningdatasisRemoveArray:(BOOL)remove
{
__weak typeof(self) weakSelf = self;
WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(PRODUCTSCREENING) WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) {
......
......@@ -2959,8 +2959,14 @@ extern NSString * const GRADEMETHOD_MANUL;
*
*/
@property (nonatomic, copy) NSString *updateDate;
@end /* interface TOPrizeEntity */
/**
* (no documentation provided)
*
*
*/
@property (nonatomic, strong) TOAttachmentEntity *attachment;
@end /* interface TOPrizeEntity */
/**
......
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