Commit 1fdb50ad authored by 曹云霄's avatar 曹云霄

购物车增加手动促销、优化代码

parent b8e88c23
...@@ -55,6 +55,6 @@ ...@@ -55,6 +55,6 @@
/** /**
* 改变京东卡状态后需要刷新 * 改变京东卡状态后需要刷新
*/ */
@property (nonatomic,copy) void(^refreshJDCardList)(); @property (nonatomic,copy) void(^refreshJDCardList)(BOOL isComplete);
@end @end
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
make.size.equalTo(self.cardPasswordLabel); make.size.equalTo(self.cardPasswordLabel);
}]; }];
_maskView.delegate = self; _maskView.delegate = self;
[_maskView setImage:TCImage(@"mask") radius:10]; [_maskView setImage:TCImage(@"mask") radius:20];
} }
- (void)viewWillAppear:(BOOL)animated - (void)viewWillAppear:(BOOL)animated
...@@ -50,17 +50,18 @@ ...@@ -50,17 +50,18 @@
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(RECEIVEJDECARD),_cardModel.cardNumber] WithRequestType:Zero WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(RECEIVEJDECARD),_cardModel.cardNumber] WithRequestType:ZERO WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weakSelf SHOWPrompttext:@"领取成功"];
if (weakSelf.refreshJDCardList) { if (weakSelf.refreshJDCardList) {
weakSelf.refreshJDCardList(); weakSelf.refreshJDCardList(YES);
} }
}else }else
{ {
[weakSelf ErrorMBProgressView:@"领取失败"]; if (weakSelf.refreshJDCardList) {
weakSelf.refreshJDCardList(YES);
}
} }
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
......
...@@ -91,15 +91,17 @@ ...@@ -91,15 +91,17 @@
- (void)getCardDatasAction:(BOOL)isRemove - (void)getCardDatasAction:(BOOL)isRemove
{ {
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CARDINFORMATION) WithRequestType:Zero WithParameter:self.requestModel WithReturnValueBlock:^(id returnValue) { [self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CARDINFORMATION) WithRequestType:ZERO WithParameter:self.requestModel WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding];
weakSelf.beenUseCardCollectionView.emptyDataSetSource = self; weakSelf.beenUseCardCollectionView.emptyDataSetSource = self;
weakSelf.beenUseCardCollectionView.emptyDataSetDelegate = self; weakSelf.beenUseCardCollectionView.emptyDataSetDelegate = self;
[weakSelf endRefreshingForTableView:weakSelf.beenUseCardCollectionView]; [weakSelf endRefreshingForTableView:weakSelf.beenUseCardCollectionView];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
RsJingDongECardResponse *cardInformation = [[RsJingDongECardResponse alloc]initWithDictionary:returnValue[@"data"] error:nil]; RsJingDongECardResponse *cardInformation = [[RsJingDongECardResponse alloc]initWithDictionary:returnValue[@"data"] error:nil];
weakSelf.totalPage = cardInformation.totalpages; weakSelf.totalPage = cardInformation.totalpages;
if (cardInformation.list.count) { if (isRemove) {
[weakSelf.datasArray removeAllObjects]; [weakSelf.datasArray removeAllObjects];
} }
[weakSelf.datasArray addObjectsFromArray:cardInformation.list]; [weakSelf.datasArray addObjectsFromArray:cardInformation.list];
...@@ -109,8 +111,12 @@ ...@@ -109,8 +111,12 @@
} }
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf endRefreshingForTableView:weakSelf.beenUseCardCollectionView];
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK]; [weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.beenUseCardCollectionView];
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
} }
......
...@@ -107,15 +107,17 @@ ...@@ -107,15 +107,17 @@
- (void)getCardDatasAction:(BOOL)isRemove - (void)getCardDatasAction:(BOOL)isRemove
{ {
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding];
NSLog(@"%@",[self.requestModel toDictionary]); NSLog(@"%@",[self.requestModel toDictionary]);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CARDINFORMATION) WithRequestType:Zero WithParameter:self.requestModel WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CARDINFORMATION) WithRequestType:ZERO WithParameter:self.requestModel WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding];
weakSelf.dontUseCardCollectionView.emptyDataSetSource = weakSelf; weakSelf.dontUseCardCollectionView.emptyDataSetSource = weakSelf;
weakSelf.dontUseCardCollectionView.emptyDataSetDelegate = weakSelf; weakSelf.dontUseCardCollectionView.emptyDataSetDelegate = weakSelf;
[weakSelf endRefreshingForTableView:weakSelf.dontUseCardCollectionView]; [weakSelf endRefreshingForTableView:weakSelf.dontUseCardCollectionView];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
RsJingDongECardResponse *cardInformation = [[RsJingDongECardResponse alloc]initWithDictionary:returnValue[@"data"] error:nil]; RsJingDongECardResponse *cardInformation = [[RsJingDongECardResponse alloc]initWithDictionary:returnValue[@"data"] error:nil];
if (cardInformation.list.count) { if (isRemove) {
[weakSelf.datasArray removeAllObjects]; [weakSelf.datasArray removeAllObjects];
} }
weakSelf.totalPage = cardInformation.totalpages; weakSelf.totalPage = cardInformation.totalpages;
...@@ -126,8 +128,12 @@ ...@@ -126,8 +128,12 @@
} }
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf endRefreshingForTableView:weakSelf.dontUseCardCollectionView];
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK]; [weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.dontUseCardCollectionView];
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
} }
...@@ -152,6 +158,7 @@ ...@@ -152,6 +158,7 @@
CardOrderInformationReusableView *headerView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"CardOrderInformationReusableView" forIndexPath:indexPath]; CardOrderInformationReusableView *headerView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"CardOrderInformationReusableView" forIndexPath:indexPath];
headerView.delegate = self; headerView.delegate = self;
headerView.model = self.datasArray[indexPath.section]; headerView.model = self.datasArray[indexPath.section];
headerView.sectionIndex = indexPath.section;
return headerView; return headerView;
} }
return nil; return nil;
...@@ -180,7 +187,8 @@ ...@@ -180,7 +187,8 @@
pop.sourceView = settlement.view; pop.sourceView = settlement.view;
settlement.cardModel = model.eCards[indexPath.row]; settlement.cardModel = model.eCards[indexPath.row];
WS(weakSelf); WS(weakSelf);
[settlement setRefreshJDCardList:^{ [settlement setRefreshJDCardList:^(BOOL boolValue) {
[weakSelf SHOWPrompttext:boolValue?@"领取成功":@"领取失败"];
[weakSelf.dontUseCardCollectionView.mj_header beginRefreshing]; [weakSelf.dontUseCardCollectionView.mj_header beginRefreshing];
[[NSNotificationCenter defaultCenter] postNotificationName:VIEWPASSWORD object:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:VIEWPASSWORD object:nil];
}]; }];
...@@ -267,17 +275,17 @@ ...@@ -267,17 +275,17 @@
{ {
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(ACTIVIATIONJDECARD),self.orderNumber,imagePath] WithRequestType:Zero WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(ACTIVIATIONJDECARD),self.orderNumber,imagePath] WithRequestType:ZERO WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weakSelf SuccessMBProgressView:@"激活成功"]; [weakSelf SuccessMBProgressView:@"激活成功"];
for (GroupByOrderNumber *order in weakSelf.datasArray) { for (GroupByOrderNumber *order in weakSelf.datasArray) {
if ([order.orderNumber isEqualToString:self.orderNumber]) { if ([order.orderNumber isEqualToString:self.orderNumber]) {
order.orderReceiptUrl = imagePath;break; order.orderReceiptUrl = imagePath;
[weakSelf.dontUseCardCollectionView reloadSections:[NSIndexSet indexSetWithIndex:[weakSelf.datasArray indexOfObject:order]]];break;
} }
} }
[[NSNotificationCenter defaultCenter] postNotificationName:UPLOAD_COMPLETE object:nil];
}else{ }else{
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
......
...@@ -11,11 +11,6 @@ ...@@ -11,11 +11,6 @@
@implementation CardOrderInformationReusableView @implementation CardOrderInformationReusableView
- (void)awakeFromNib
{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(uploadCompleteHiddenButton:) name:UPLOAD_COMPLETE object:nil];
}
#pragma mark - 上传小票 #pragma mark - 上传小票
- (IBAction)uploadReceiptsButtonClickAction:(UIButton *)sender { - (IBAction)uploadReceiptsButtonClickAction:(UIButton *)sender {
...@@ -32,12 +27,6 @@ ...@@ -32,12 +27,6 @@
self.uploadReceiptsButton.hidden = [BaseViewController isBlankString:_model.orderReceiptUrl]?NO:YES; self.uploadReceiptsButton.hidden = [BaseViewController isBlankString:_model.orderReceiptUrl]?NO:YES;
} }
#pragma mark - 上传完成隐藏按钮
- (void)uploadCompleteHiddenButton:(NSNotification *)sender
{
self.uploadReceiptsButton.hidden = YES;
}
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [[NSNotificationCenter defaultCenter] removeObserver:self];
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
- (void)getCardDatasAction - (void)getCardDatasAction
{ {
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CARDINFORMATION) WithRequestType:Zero WithParameter:self.requestModel WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CARDINFORMATION) WithRequestType:ZERO WithParameter:self.requestModel WithReturnValueBlock:^(id returnValue) {
// weakSelf.cardCollectionView.emptyDataSetSource = self; // weakSelf.cardCollectionView.emptyDataSetSource = self;
// weakSelf.cardCollectionView.emptyDataSetDelegate = self; // weakSelf.cardCollectionView.emptyDataSetDelegate = self;
......
...@@ -87,7 +87,6 @@ ...@@ -87,7 +87,6 @@
} }
} }
#pragma mark -布局 #pragma mark -布局
- (void)uiConfigAction - (void)uiConfigAction
{ {
...@@ -107,10 +106,8 @@ ...@@ -107,10 +106,8 @@
self.indexPage = 1; self.indexPage = 1;
self.customerHeader.userInteractionEnabled = YES; self.customerHeader.userInteractionEnabled = YES;
[self.customerHeader addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(customerHeaderClckAction:)]]; [self.customerHeader addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(customerHeaderClckAction:)]];
//隐藏更改客户按钮 //隐藏更改客户按钮
self.changePersonInformationButton.hidden = YES; self.changePersonInformationButton.hidden = YES;
//代理 //代理
self.informationTableview.delegate = self; self.informationTableview.delegate = self;
self.informationTableview.dataSource = self; self.informationTableview.dataSource = self;
...@@ -122,7 +119,6 @@ ...@@ -122,7 +119,6 @@
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(SetupCurrentCustomer:) name:@"SETUPCURRENTCUSTOMER" object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(SetupCurrentCustomer:) name:@"SETUPCURRENTCUSTOMER" object:nil];
//清空当前客户数据 //清空当前客户数据
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ChangeCustomerName:) name:@"EMPTYCUSTOMERNAME" object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ChangeCustomerName:) name:@"EMPTYCUSTOMERNAME" object:nil];
WS(weakSelf); WS(weakSelf);
//下拉刷新 //下拉刷新
MjRefreshHeaderCustom *headerRefresh = [MjRefreshHeaderCustom headerWithRefreshingBlock:^{ MjRefreshHeaderCustom *headerRefresh = [MjRefreshHeaderCustom headerWithRefreshingBlock:^{
...@@ -157,7 +153,7 @@ ...@@ -157,7 +153,7 @@
#pragma mark -获取导购关联客户 #pragma mark -获取导购关联客户
- (void)getShoppersAssociatedCustomer:(ConsumerQueryCondition *)condition isRemoveArray:(BOOL)remove - (void)getShoppersAssociatedCustomer:(ConsumerQueryCondition *)condition isRemoveArray:(BOOL)remove
{ {
__weak typeof(self) weakSelf = self; WS(weakSelf);
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(GETSHOPPERSCONSUMER) WithRequestType:0 WithParameter:condition WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(GETSHOPPERSCONSUMER) WithRequestType:0 WithParameter:condition WithReturnValueBlock:^(id returnValue) {
...@@ -212,12 +208,13 @@ ...@@ -212,12 +208,13 @@
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf promptCustomerWithString:@"网络连接已断开"]; [weakSelf promptCustomerWithString:NETWORK];
} WithFailureBlock:^(id error) { } WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf endRefreshingForTableView:weakSelf.informationTableview]; [weakSelf endRefreshingForTableView:weakSelf.informationTableview];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
} }
...@@ -229,7 +226,7 @@ ...@@ -229,7 +226,7 @@
cell.indexNumber = indexPath.row; cell.indexNumber = indexPath.row;
cell.model = [self.CustomerresultArray objectAtIndex_opple:indexPath.row]; cell.model = [self.CustomerresultArray objectAtIndex_opple:indexPath.row];
//清空其他选中状态 //清空其他选中状态
__weak typeof(self) weakSelf = self; WS(weakSelf);
[cell setBlockSeletced:^(NSInteger index) { [cell setBlockSeletced:^(NSInteger index) {
[weakSelf SetCustomerButtonClick:index]; [weakSelf SetCustomerButtonClick:index];
}]; }];
...@@ -254,13 +251,12 @@ ...@@ -254,13 +251,12 @@
clientdetails.model = [self.CustomerresultArray objectAtIndex_opple:indexPath.row]; clientdetails.model = [self.CustomerresultArray objectAtIndex_opple:indexPath.row];
clientdetails.cellindex = indexPath.row; clientdetails.cellindex = indexPath.row;
//设置当前客户 //设置当前客户
__weak typeof(self) weakSelf = self; WS(weakSelf);
[clientdetails setCurrentUserBlock:^(NSInteger index,NSString *title) { [clientdetails setCurrentUserBlock:^(NSInteger index,NSString *title) {
if ([title isEqualToString:@"设为当前客户"]) { if ([title isEqualToString:@"设为当前客户"]) {
InformationTableViewCell *cell = [weakSelf.informationTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0]]; InformationTableViewCell *cell = [weakSelf.informationTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0]];
[weakSelf SetCustomerButtonClick:index]; [weakSelf SetCustomerButtonClick:index];
cell.setCurrentCustomer.selected = YES; cell.setCurrentCustomer.selected = YES;
}else if ([title isEqualToString:@"退出当前客户"]) }else if ([title isEqualToString:@"退出当前客户"])
{ {
[weakSelf ExitCurrentCustomer]; [weakSelf ExitCurrentCustomer];
...@@ -316,23 +312,18 @@ ...@@ -316,23 +312,18 @@
#pragma mark -设置为当前客户回调2 #pragma mark -设置为当前客户回调2
- (void)SetCustomerButtonClick:(NSInteger)index; - (void)SetCustomerButtonClick:(NSInteger)index;
{ {
for (InformationTableViewCell *cell in self.informationTableview.visibleCells) { for (InformationTableViewCell *cell in self.informationTableview.visibleCells) {
cell.setCurrentCustomer.selected = NO; cell.setCurrentCustomer.selected = NO;
} }
for (MyclientEntityModel *model in self.CustomerresultArray) { for (MyclientEntityModel *model in self.CustomerresultArray) {
model.selectedState = NO; model.selectedState = NO;
} }
MyclientEntityModel *model = [self.CustomerresultArray objectAtIndex_opple:index]; MyclientEntityModel *model = [self.CustomerresultArray objectAtIndex_opple:index];
model.selectedState = YES; model.selectedState = YES;
self.customerNameField.text = model.name; self.customerNameField.text = model.name;
self.phoneNumberField.text = model.mobile; self.phoneNumberField.text = model.mobile;
self.customerAddress.text = model.address; self.customerAddress.text = model.address;
self.companyNameField.text = model.company; self.companyNameField.text = model.company;
[self.customerHeader sd_setImageWithURL:[NSURL URLWithString:model.picture] placeholderImage:TCImage(@"now")]; [self.customerHeader sd_setImageWithURL:[NSURL URLWithString:model.picture] placeholderImage:TCImage(@"now")];
//保存客户信息 //保存客户信息
[Shoppersmanager manager].currentCustomer = YES; [Shoppersmanager manager].currentCustomer = YES;
......
...@@ -48,8 +48,6 @@ ...@@ -48,8 +48,6 @@
*/ */
@property (weak, nonatomic) IBOutlet UIButton *setCurrentCustomer; @property (weak, nonatomic) IBOutlet UIButton *setCurrentCustomer;
/** /**
* 数据源 * 数据源
*/ */
...@@ -60,7 +58,6 @@ ...@@ -60,7 +58,6 @@
*/ */
@property (nonatomic,assign) NSInteger indexNumber; @property (nonatomic,assign) NSInteger indexNumber;
/** /**
* 反传回控制器.cell位置 * 反传回控制器.cell位置
*/ */
......
...@@ -30,20 +30,15 @@ ...@@ -30,20 +30,15 @@
self.setCurrentCustomer.selected = _model.selectedState; self.setCurrentCustomer.selected = _model.selectedState;
} }
#pragma mark -设为当前用户 #pragma mark -设为当前用户
- (IBAction)SelectedButtonClick:(UIButton *)sender { - (IBAction)SelectedButtonClick:(UIButton *)sender {
if (self.blockSeletced) { if (self.blockSeletced) {
self.blockSeletced(_indexNumber); self.blockSeletced(_indexNumber);
} }
sender.selected = YES; sender.selected = YES;
} }
- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated]; [super setSelected:selected animated:animated];
......
...@@ -138,7 +138,7 @@ NSString *const lotteryAction = @"lotteryAction"; ...@@ -138,7 +138,7 @@ NSString *const lotteryAction = @"lotteryAction";
[super viewDidLoad]; [super viewDidLoad];
[self uiConfigAction]; [self uiConfigAction];
[self getOrderDetailsData:NO issueJDECard:Zero andGuideId:nil andOrderNumber:nil]; [self getOrderDetailsData:NO issueJDECard:ZERO andGuideId:nil andOrderNumber:nil];
} }
#pragma mark - UI #pragma mark - UI
...@@ -258,12 +258,13 @@ NSString *const lotteryAction = @"lotteryAction"; ...@@ -258,12 +258,13 @@ NSString *const lotteryAction = @"lotteryAction";
- (void)showJEDCard - (void)showJEDCard
{ {
JDEcardViewController *jdeCard = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"JDEcardViewController"]; JDEcardViewController *jdeCard = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"JDEcardViewController"];
jdeCard.preferredContentSize = CGSizeMake(500, 400); jdeCard.preferredContentSize = CGSizeMake(345, 360);
self.settingsPopoverController = [[WYPopoverController alloc] initWithContentViewController:jdeCard]; self.settingsPopoverController = [[WYPopoverController alloc] initWithContentViewController:jdeCard];
self.settingsPopoverController.popoverLayoutMargins = UIEdgeInsetsMake(10, 20, 10, 20); self.settingsPopoverController.popoverLayoutMargins = UIEdgeInsetsMake(10, 20, 10, 20);
self.settingsPopoverController.wantsDefaultContentAppearance = NO; self.settingsPopoverController.wantsDefaultContentAppearance = NO;
self.settingsPopoverController.theme.fillBottomColor = [UIColor clearColor]; self.settingsPopoverController.theme.fillBottomColor = [UIColor clearColor];
self.settingsPopoverController.theme.fillTopColor = [UIColor clearColor]; self.settingsPopoverController.theme.fillTopColor = [UIColor clearColor];
self.settingsPopoverController.theme.glossShadowColor = [UIColor clearColor];
[self.settingsPopoverController presentPopoverAsDialogAnimated:YES [self.settingsPopoverController presentPopoverAsDialogAnimated:YES
options:WYPopoverAnimationOptionFadeWithScale]; options:WYPopoverAnimationOptionFadeWithScale];
} }
...@@ -345,12 +346,12 @@ NSString *const lotteryAction = @"lotteryAction"; ...@@ -345,12 +346,12 @@ NSString *const lotteryAction = @"lotteryAction";
//支付成功 //支付成功
WS(weakSelf); WS(weakSelf);
[settlement setPaySuccessReturnBlock:^{ [settlement setPaySuccessReturnBlock:^{
[weakSelf SuccessMBProgressView:@"支付成功"];
weakSelf.isDelectedButton = NO; weakSelf.isDelectedButton = NO;
weakSelf.isUserInteractionEnabled = NO; weakSelf.isUserInteractionEnabled = NO;
[weakSelf CreateTableviewHeaderView]; [weakSelf CreateTableviewHeaderView];
//** 京东E卡 */ //** 京东E卡 */
for (id object in self.luckyDrawAndJDECardArray) { for (id object in weakSelf.luckyDrawAndJDECardArray) {
if ([object isKindOfClass:[PromotionalDeductionModel class]]) { if ([object isKindOfClass:[PromotionalDeductionModel class]]) {
PromotionalDeductionModel *model = (PromotionalDeductionModel *)object; PromotionalDeductionModel *model = (PromotionalDeductionModel *)object;
if ([model.type isEqualToString:JDECardAction]) { if ([model.type isEqualToString:JDECardAction]) {
...@@ -358,6 +359,10 @@ NSString *const lotteryAction = @"lotteryAction"; ...@@ -358,6 +359,10 @@ NSString *const lotteryAction = @"lotteryAction";
} }
} }
} }
//** 无促销的情况 */
if (self.luckyDrawAndJDECardArray.count == 0) {
[weakSelf getOrderDetailsData:NO issueJDECard:ZERO andGuideId:nil andOrderNumber:nil];
}
weakSelf.orderDetailsTableview.tableFooterView = nil; weakSelf.orderDetailsTableview.tableFooterView = nil;
if (weakSelf.DelecteAndPayButtonBlock) { if (weakSelf.DelecteAndPayButtonBlock) {
weakSelf.DelecteAndPayButtonBlock(_cellindex,@"002"); weakSelf.DelecteAndPayButtonBlock(_cellindex,@"002");
...@@ -572,23 +577,22 @@ NSString *const lotteryAction = @"lotteryAction"; ...@@ -572,23 +577,22 @@ NSString *const lotteryAction = @"lotteryAction";
[self DownloadPDF:^(id Value) { [self DownloadPDF:^(id Value) {
[weakSelf CreateMBProgressHUDLoding]; [weakSelf CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] DownloadPDFdatasWithURL:Value WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] DownloadPDFdatasWithURL:Value WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf callAirprintWithdata:returnValue SuccessBlock:^{ [weakSelf callAirprintWithdata:returnValue SuccessBlock:^{
[weakSelf SuccessMBProgressView:@"打印完成"]; [weakSelf SuccessMBProgressView:@"打印完成"];
} ErrorBlock:^{ } ErrorBlock:^{
[weakSelf ErrorMBProgressView:@"打印失败"]; [weakSelf ErrorMBProgressView:@"打印失败"];
}]; }];
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
}]; }];
} }
#pragma mark -下载PDF #pragma mark -下载PDF
- (void)DownloadPDF:(void(^)(id returnValue))success - (void)DownloadPDF:(void(^)(id returnValue))success
{ {
...@@ -602,26 +606,19 @@ NSString *const lotteryAction = @"lotteryAction"; ...@@ -602,26 +606,19 @@ NSString *const lotteryAction = @"lotteryAction";
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:@"网络中断"]; [weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(id error) { } WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
} }
#pragma mark -预览订单、撤销订单 #pragma mark -预览订单、撤销订单
- (void)PreviewButtonClick:(UIButton *)button - (void)PreviewButtonClick:(UIButton *)button
{ {
WS(weakSelf); WS(weakSelf);
if ([button.currentTitle isEqualToString:@"预览"]) { if ([button.currentTitle isEqualToString:@"预览"]) {
[self DownloadPDF:^(id returnValue) { [self DownloadPDF:^(id returnValue) {
// self.PDFpath = returnValue;
// QLPreviewController *previewController = [[QLPreviewController alloc] init];
// previewController.dataSource = weakSelf;
// previewController.navigationController.navigationBarHidden = YES;
// [weakSelf presentViewController:previewController animated:YES completion:nil];
PDFViewController *pdfvc = [[PDFViewController alloc]init]; PDFViewController *pdfvc = [[PDFViewController alloc]init];
pdfvc.pdfURLString = returnValue; pdfvc.pdfURLString = returnValue;
[weakSelf presentViewController:pdfvc animated:YES completion:nil]; [weakSelf presentViewController:pdfvc animated:YES completion:nil];
...@@ -650,17 +647,16 @@ NSString *const lotteryAction = @"lotteryAction"; ...@@ -650,17 +647,16 @@ NSString *const lotteryAction = @"lotteryAction";
if (weakSelf.DelecteAndPayButtonBlock) { if (weakSelf.DelecteAndPayButtonBlock) {
weakSelf.DelecteAndPayButtonBlock(_cellindex,@"005"); weakSelf.DelecteAndPayButtonBlock(_cellindex,@"005");
} }
} } else {
else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
}]]; }]];
[self presentViewController:alertVC animated:YES completion:nil]; [self presentViewController:alertVC animated:YES completion:nil];
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
if (!_model) { if (!_model) {
_model = [[RsCommissionRequest alloc]init]; _model = [[RsCommissionRequest alloc]init];
DataPage *page = [[DataPage alloc]init]; DataPage *page = [[DataPage alloc]init];
page.page = Zero; page.page = ZERO;
page.rows = KROWS; page.rows = KROWS;
_model.page = page; _model.page = page;
_model.emploreeId = [Shoppersmanager manager].Shoppers.employee.fid; _model.emploreeId = [Shoppersmanager manager].Shoppers.employee.fid;
......
...@@ -405,7 +405,7 @@ ...@@ -405,7 +405,7 @@
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:@"无网络"]; [weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(id error) { } WithFailureBlock:^(id error) {
[weakSelf ErrorMBProgressView:@"添加购物车失败"]; [weakSelf ErrorMBProgressView:@"添加购物车失败"];
}]; }];
......
...@@ -121,11 +121,11 @@ ...@@ -121,11 +121,11 @@
#pragma mark -获取商品列表数据 #pragma mark -获取商品列表数据
- (void)getGoodsListDatasisRemove:(BOOL)remove Withobject:(GoodsCondition *)conditon - (void)getGoodsListDatasisRemove:(BOOL)remove Withobject:(GoodsCondition *)conditon
{ {
__weak typeof(self)weakSelf = self; WS(weakSelf);
[self getGoodsListdatas:conditon returnResponse:^(GoodsResponse *response) { [self getGoodsListdatas:conditon returnResponse:^(GoodsResponse *response) {
if (remove) { if (remove) {
[self.datasArray removeAllObjects]; [weakSelf.datasArray removeAllObjects];
} }
for (TOGoodsEntity *model in response.goodsEntity) { for (TOGoodsEntity *model in response.goodsEntity) {
[weakSelf.datasArray addObject:model]; [weakSelf.datasArray addObject:model];
...@@ -137,32 +137,29 @@ ...@@ -137,32 +137,29 @@
#pragma mark -获取产品筛选数据 #pragma mark -获取产品筛选数据
- (void)getScreeningdatasisRemoveArray:(BOOL)remove - (void)getScreeningdatasisRemoveArray:(BOOL)remove
{ {
WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(PRODUCTSCREENING) WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(PRODUCTSCREENING) WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
if (remove) { if (remove) {
[self.screeningDatas removeAllObjects]; [weakSelf.screeningDatas removeAllObjects];
} }
GoodsFilter *goodsStyle = [[GoodsFilter alloc]initWithDictionary:returnValue[@"data"] error:nil]; GoodsFilter *goodsStyle = [[GoodsFilter alloc]initWithDictionary:returnValue[@"data"] error:nil];
[self.screeningDatas addObject:goodsStyle.styles]; [weakSelf.screeningDatas addObject:goodsStyle.styles];
[self.screeningDatas addObject:goodsStyle.categories]; [weakSelf.screeningDatas addObject:goodsStyle.categories];
[self.screeningDatas addObject:goodsStyle.space]; [weakSelf.screeningDatas addObject:goodsStyle.space];
[self.screeningDatas addObject:goodsStyle.material]; [weakSelf.screeningDatas addObject:goodsStyle.material];
[self.screeningDatas addObject:goodsStyle.price]; [weakSelf.screeningDatas addObject:goodsStyle.price];
} }
else else
{ {
[self ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
[self RemoveMBProgressHUDLoding]; [weakSelf ErrorMBProgressView:NETWORK];
[self ErrorMBProgressView:@"无网络"];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
[self ErrorMBProgressView:error.localizedDescription];
}]; }];
} }
...@@ -192,23 +189,20 @@ ...@@ -192,23 +189,20 @@
} }
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf endRefreshingForTableView:weakSelf.productCollectionView];
[weakSelf ErrorMBProgressView:@"网络连接中断"]; [weakSelf ErrorMBProgressView:NETWORK];
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.productCollectionView];
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
} }
#pragma mark -布局 #pragma mark -布局
- (void)uiConfigAction - (void)uiConfigAction
{ {
self.indexPage = 1; self.indexPage = 1;
self.selectedIndex = 9999; self.selectedIndex = 9999;//无任何意义
self.productCollectionLayout.itemSize = CGSizeMake((ScreenWidth-100)/3, (ScreenWidth-100)/3); self.productCollectionLayout.itemSize = CGSizeMake((ScreenWidth-100)/3, (ScreenWidth-100)/3);
self.productCollectionLayout.sectionInset = UIEdgeInsetsMake(20, 30, 20, 30); self.productCollectionLayout.sectionInset = UIEdgeInsetsMake(20, 30, 20, 30);
self.productCollectionLayout.minimumLineSpacing = 20; self.productCollectionLayout.minimumLineSpacing = 20;
...@@ -222,16 +216,12 @@ ...@@ -222,16 +216,12 @@
#pragma mark -获取数据 #pragma mark -获取数据
- (void)GetdatasAction - (void)GetdatasAction
{ {
WS(weakSelf);
__weak typeof(self) weakSelf = self;
//下拉刷新 //下拉刷新
MjRefreshHeaderCustom *headerRefresh = [MjRefreshHeaderCustom headerWithRefreshingBlock:^{ MjRefreshHeaderCustom *headerRefresh = [MjRefreshHeaderCustom headerWithRefreshingBlock:^{
//扫描二维码结果 //扫描二维码结果
if (weakSelf.barcode) { if (weakSelf.barcode) {
[weakSelf barCodeSearchRequest]; [weakSelf barCodeSearchRequest];
}else }else
{ {
//分页数据 //分页数据
...@@ -287,12 +277,9 @@ ...@@ -287,12 +277,9 @@
[self.productCollectionView.mj_header beginRefreshing]; [self.productCollectionView.mj_header beginRefreshing];
//上拉加载 //上拉加载
self.productCollectionView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{ self.productCollectionView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
//扫描二维码结果 //扫描二维码结果
if (weakSelf.barcode) { if (weakSelf.barcode) {
[weakSelf barCodeSearchRequest]; [weakSelf barCodeSearchRequest];
}else }else
{ {
if ( ++ weakSelf.indexPage > weakSelf.totalPages) { if ( ++ weakSelf.indexPage > weakSelf.totalPages) {
...@@ -345,45 +332,44 @@ ...@@ -345,45 +332,44 @@
} }
}]; }];
self.productCollectionView.mj_footer.automaticallyHidden = YES; self.productCollectionView.mj_footer.automaticallyHidden = YES;
} }
#pragma mark 填条形码搜索 #pragma mark 填条形码搜索
- (void)barCodeSearchRequest - (void)barCodeSearchRequest
{ {
WS(weakSelf);
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(BARCODESEARCH),_barcode] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(BARCODESEARCH),_barcode] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[self endRefreshingForTableView:self.productCollectionView]; [weakSelf endRefreshingForTableView:self.productCollectionView];
[self RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
if ([returnValue[@"data"] isKindOfClass:[NSNull class]]) { if ([returnValue[@"data"] isKindOfClass:[NSNull class]]) {
[self ErrorMBProgressView:@"暂无商品信息"]; [weakSelf ErrorMBProgressView:@"暂无商品信息"];
return; return;
} }
TOGoodsEntity *goods = [[TOGoodsEntity alloc]initWithDictionary:returnValue[@"data"] error:nil]; TOGoodsEntity *goods = [[TOGoodsEntity alloc]initWithDictionary:returnValue[@"data"] error:nil];
[self.datasArray removeAllObjects]; [weakSelf.datasArray removeAllObjects];
[self.datasArray addObject:goods]; [weakSelf.datasArray addObject:goods];
[self.productCollectionView reloadData]; [weakSelf.productCollectionView reloadData];
}else }else
{ {
[self ErrorMBProgressView:@"查询失败"]; [weakSelf ErrorMBProgressView:@"查询失败"];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
[self endRefreshingForTableView:self.productCollectionView]; [weakSelf RemoveMBProgressHUDLoding];
[self ErrorMBProgressView:@"网络连接中断"]; [weakSelf endRefreshingForTableView:self.productCollectionView];
[self RemoveMBProgressHUDLoding]; [weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(id error) { } WithFailureBlock:^(id error) {
[self ErrorMBProgressView:@"查询失败"]; [weakSelf endRefreshingForTableView:self.productCollectionView];
[self endRefreshingForTableView:self.productCollectionView]; [weakSelf RemoveMBProgressHUDLoding];
[self RemoveMBProgressHUDLoding]; [weakSelf ErrorMBProgressView:@"查询失败"];
}]; }];
} }
...@@ -521,7 +507,6 @@ ...@@ -521,7 +507,6 @@
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{ {
ProductDetailsViewController *productDetails = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"productdetails"]; ProductDetailsViewController *productDetails = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"productdetails"];
productDetails.goodsID = [[self.datasArray objectAtIndex_opple:indexPath.item] fid]; productDetails.goodsID = [[self.datasArray objectAtIndex_opple:indexPath.item] fid];
[self.navigationController pushViewController:productDetails animated:YES]; [self.navigationController pushViewController:productDetails animated:YES];
...@@ -531,7 +516,6 @@ ...@@ -531,7 +516,6 @@
#pragma mark -筛选 #pragma mark -筛选
- (void)ScreeningButtonClick - (void)ScreeningButtonClick
{ {
self.screenView = [[[NSBundle mainBundle] loadNibNamed:@"ScreeningView" owner:self options:nil]firstObject]; self.screenView = [[[NSBundle mainBundle] loadNibNamed:@"ScreeningView" owner:self options:nil]firstObject];
self.screenView.frame = CGRectMake(0, 0, ScreenWidth, ScreenHeight); self.screenView.frame = CGRectMake(0, 0, ScreenWidth, ScreenHeight);
self.screenView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5]; self.screenView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
...@@ -544,15 +528,11 @@ ...@@ -544,15 +528,11 @@
self.screenView.frame = CGRectMake(0, 0, ScreenWidth, ScreenHeight); self.screenView.frame = CGRectMake(0, 0, ScreenWidth, ScreenHeight);
[self.view.window addSubview:self.screenView]; [self.view.window addSubview:self.screenView];
self.screenView.alpha = 0; self.screenView.alpha = 0;
//监听Segmented菜单 //监听Segmented菜单
[self.screenView.sortingSegmented addTarget:self action:@selector(sortingSegmentedClick:) forControlEvents:UIControlEventValueChanged]; [self.screenView.sortingSegmented addTarget:self action:@selector(sortingSegmentedClick:) forControlEvents:UIControlEventValueChanged];
self.selectedIndex = 0; self.selectedIndex = 0;
[self CreateClassificationView]; [self CreateClassificationView];
[UIView animateWithDuration:0.2 animations:^{ [UIView animateWithDuration:0.2 animations:^{
self.screenView.alpha = 1; self.screenView.alpha = 1;
}]; }];
} }
......
...@@ -146,8 +146,8 @@ ...@@ -146,8 +146,8 @@
return NO; return NO;
} }
} }
NSRange zeroRange = [textField.text rangeOfString:@"0"]; NSRange ZERORange = [textField.text rangeOfString:@"0"];
if(zeroRange.length == 1 && zeroRange.location == 0){ //判断输入框第一个字符是否为“0” if(ZERORange.length == 1 && ZERORange.location == 0){ //判断输入框第一个字符是否为“0”
if(![string isEqualToString:@"0"] && ![string isEqualToString:@"."] && [textField.text length] == 1){ //当输入框只有一个字符并且字符为“0”时,再输入不为“0”或者“.”的字符时,则将此输入替换输入框的这唯一字符。 if(![string isEqualToString:@"0"] && ![string isEqualToString:@"."] && [textField.text length] == 1){ //当输入框只有一个字符并且字符为“0”时,再输入不为“0”或者“.”的字符时,则将此输入替换输入框的这唯一字符。
textField.text = string; textField.text = string;
return NO; return NO;
......
...@@ -355,12 +355,10 @@ ...@@ -355,12 +355,10 @@
} }
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
WS(weakSelf); WS(weakSelf);
NSLog(@"%@",[[order toDictionary] JSONString]);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CONFIRMPAY) WithRequestType:0 WithParameter:order WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CONFIRMPAY) WithRequestType:0 WithParameter:order WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weakSelf ErrorMBProgressView:@"支付成功"];
if (weakSelf.PaySuccessReturnBlock) { if (weakSelf.PaySuccessReturnBlock) {
weakSelf.PaySuccessReturnBlock(); weakSelf.PaySuccessReturnBlock();
} }
......
...@@ -484,11 +484,8 @@ ...@@ -484,11 +484,8 @@
#pragma mark -设置为当前地址回调 #pragma mark -设置为当前地址回调
- (void)SetCustomerButtonClick:(NSInteger)index; - (void)SetCustomerButtonClick:(NSInteger)index;
{ {
for (UITableViewCell *cell in self.generateOrderTableview.visibleCells) { for (UITableViewCell *cell in self.generateOrderTableview.visibleCells) {
if ([cell isKindOfClass:[GenerateOrdersTableViewCell class]]) { if ([cell isKindOfClass:[GenerateOrdersTableViewCell class]]) {
GenerateOrdersTableViewCell *Newcell = (GenerateOrdersTableViewCell *)cell; GenerateOrdersTableViewCell *Newcell = (GenerateOrdersTableViewCell *)cell;
Newcell.isSelectedButton.selected = NO; Newcell.isSelectedButton.selected = NO;
} }
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
/** /**
* 当前商品数量、成交价 ,通过返回参数判断是否能修改 * 当前商品数量、成交价 ,通过返回参数判断是否能修改
*/ */
- (void)ChangeGoodsNumber:(NSInteger)goodsNumber WithcostPrice:(CGFloat)costprice Withcellindex:(NSInteger)cellindex returnValue:(void(^)(id value))result; - (void)changeGoodsNumber:(NSInteger)goodsNumber WithcostPrice:(CGFloat)costprice Withcellindex:(NSInteger)cellindex returnValue:(void(^)(id value))result;
@end @end
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
break; break;
case 101://增加 case 101://增加
{ {
if (goodsNumber >= [_model.goods.number integerValue]) { if (goodsNumber >= [self.model.goods.number integerValue]) {
//不能大于库存 //不能大于库存
if (self.promptStringBlock) { if (self.promptStringBlock) {
self.promptStringBlock(@"个数不能大于库存"); self.promptStringBlock(@"个数不能大于库存");
...@@ -81,12 +81,14 @@ ...@@ -81,12 +81,14 @@
} }
//改变价格 //改变价格
WS(weakSelf); WS(weakSelf);
if ([self.delegate respondsToSelector:@selector(ChangeGoodsNumber:WithcostPrice:Withcellindex:returnValue:)]) { if ([self.delegate respondsToSelector:@selector(changeGoodsNumber:WithcostPrice:Withcellindex:returnValue:)]) {
[self.delegate ChangeGoodsNumber:goodsNumber WithcostPrice:[self.clinchTextfield.text floatValue]Withcellindex:_cellindex returnValue:^(id value) { [self.delegate changeGoodsNumber:goodsNumber WithcostPrice:[self.clinchTextfield.text floatValue]Withcellindex:_cellindex returnValue:^(id value) {
if ([value isKindOfClass:[NSDictionary class]]) { if ([value isKindOfClass:[NSDictionary class]]) {
if ([value[@"code"] isEqualToNumber:@0]) { if ([value[@"code"] isEqualToNumber:@0]) {
weakSelf.goodsNumbersLabe.text = [NSString stringWithFormat:@"%ld",goodsNumber]; weakSelf.goodsNumbersLabe.text = [NSString stringWithFormat:@"%ld",goodsNumber];
weakSelf.productPriceLabe.text = [NSString stringWithFormat:@"¥%.2f",[self.goodsNumbersLabe.text integerValue]*[self.clinchTextfield.text floatValue]]; weakSelf.productPriceLabe.text = [NSString stringWithFormat:@"¥%.2f",goodsNumber*[self.clinchTextfield.text floatValue]];
self.model.costPrice = [NSNumber numberWithFloat:[self.clinchTextfield.text floatValue]];
self.model.goodsNum = goodsNumber;
} }
} }
}]; }];
...@@ -120,8 +122,8 @@ ...@@ -120,8 +122,8 @@
//改变价格 //改变价格
self.productPriceLabe.text = [NSString stringWithFormat:@"¥%.2f",[self.goodsNumbersLabe.text integerValue]*[textField.text floatValue]]; self.productPriceLabe.text = [NSString stringWithFormat:@"¥%.2f",[self.goodsNumbersLabe.text integerValue]*[textField.text floatValue]];
if ([self.delegate respondsToSelector:@selector(ChangeGoodsNumber:WithcostPrice:Withcellindex:returnValue:)]) { if ([self.delegate respondsToSelector:@selector(changeGoodsNumber:WithcostPrice:Withcellindex:returnValue:)]) {
[self.delegate ChangeGoodsNumber:[self.goodsNumbersLabe.text integerValue] WithcostPrice:[self.clinchTextfield.text floatValue]Withcellindex:_cellindex returnValue:^(id value) { [self.delegate changeGoodsNumber:[self.goodsNumbersLabe.text integerValue] WithcostPrice:[self.clinchTextfield.text floatValue]Withcellindex:_cellindex returnValue:^(id value) {
}]; }];
} }
} }
...@@ -153,8 +155,8 @@ ...@@ -153,8 +155,8 @@
return NO; return NO;
} }
} }
NSRange zeroRange = [textField.text rangeOfString:@"0"]; NSRange ZERORange = [textField.text rangeOfString:@"0"];
if(zeroRange.length == 1 && zeroRange.location == 0){ //判断输入框第一个字符是否为“0” if(ZERORange.length == 1 && ZERORange.location == 0){ //判断输入框第一个字符是否为“0”
if(![string isEqualToString:@"0"] && ![string isEqualToString:@"."] && [textField.text length] == 1){ //当输入框只有一个字符并且字符为“0”时,再输入不为“0”或者“.”的字符时,则将此输入替换输入框的这唯一字符。 if(![string isEqualToString:@"0"] && ![string isEqualToString:@"."] && [textField.text length] == 1){ //当输入框只有一个字符并且字符为“0”时,再输入不为“0”或者“.”的字符时,则将此输入替换输入框的这唯一字符。
textField.text = string; textField.text = string;
return NO; return NO;
......
...@@ -32,6 +32,11 @@ ...@@ -32,6 +32,11 @@
*/ */
@property (weak, nonatomic) IBOutlet UIButton *allSelectedButton; @property (weak, nonatomic) IBOutlet UIButton *allSelectedButton;
/**
* 折扣比例
*/
@property (weak, nonatomic) IBOutlet UITextField *discountTextField;
@end @end
This diff is collapsed.
...@@ -100,8 +100,8 @@ ...@@ -100,8 +100,8 @@
#pragma mark -UI #pragma mark -UI
- (void)uiConfigAction - (void)uiConfigAction
{ {
self.tabBar.frame = CGRectMake(Zero, Zero, ScreenWidth, NavigationHeight); self.tabBar.frame = CGRectMake(ZERO, ZERO, ScreenWidth, NavigationHeight);
self.toolview = [[Toolview alloc]initWithFrame:CGRectMake(Zero, Zero, ScreenWidth, NavigationHeight)]; self.toolview = [[Toolview alloc]initWithFrame:CGRectMake(ZERO, ZERO, ScreenWidth, NavigationHeight)];
self.toolview.delegate = self; self.toolview.delegate = self;
self.toolview.inputField.delegate = self; self.toolview.inputField.delegate = self;
self.delegate = self; self.delegate = self;
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
if (!_model) { if (!_model) {
_model = [[RsApplyBillRequest alloc]init]; _model = [[RsApplyBillRequest alloc]init];
DataPage *page = [[DataPage alloc]init]; DataPage *page = [[DataPage alloc]init];
page.page = Zero; page.page = ZERO;
page.rows = KROWS; page.rows = KROWS;
_model.page = page; _model.page = page;
_model.employeeId = [Shoppersmanager manager].Shoppers.employee.fid; _model.employeeId = [Shoppersmanager manager].Shoppers.employee.fid;
......
This diff is collapsed.
...@@ -289,7 +289,7 @@ ...@@ -289,7 +289,7 @@
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="X4y-1C-nSB" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="X4y-1C-nSB" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="1784" y="433"/> <point key="canvasLocation" x="1769" y="490"/>
</scene> </scene>
<!--Clientdetails View Controller--> <!--Clientdetails View Controller-->
<scene sceneID="lDH-lU-tQw"> <scene sceneID="lDH-lU-tQw">
...@@ -1283,7 +1283,7 @@ ...@@ -1283,7 +1283,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="JDECard" id="vNC-g1-zfP"> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="JDECard" id="vNC-g1-zfP">
<rect key="frame" x="134" y="312" width="500" height="400"/> <rect key="frame" x="212" y="332" width="345" height="360"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</imageView> </imageView>
...@@ -1910,16 +1910,16 @@ ...@@ -1910,16 +1910,16 @@
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/> <color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" multipleTouchEnabled="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="SzO-sh-Q17"> <label opaque="NO" multipleTouchEnabled="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="SzO-sh-Q17">
<rect key="frame" x="668" y="18" width="144" height="25"/> <rect key="frame" x="668" y="18" width="144" height="25"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="24"/> <fontDescription key="fontDescription" type="system" pointSize="24"/>
<color key="textColor" red="0.9882352941176471" green="0.33725490196078434" blue="0.12941176470588234" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.9882352941176471" green="0.33725490196078434" blue="0.12941176470588234" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" multipleTouchEnabled="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="合计金额:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="lfY-O6-zCQ"> <label opaque="NO" multipleTouchEnabled="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="折扣比例(%):" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="5UU-hv-OWB">
<rect key="frame" x="604" y="21" width="85" height="21"/> <rect key="frame" x="392" y="21" width="82" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/> <fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
...@@ -1954,6 +1954,18 @@ ...@@ -1954,6 +1954,18 @@
<action selector="delecteSelectedGoods:" destination="4Ho-ZE-RT8" eventType="touchUpInside" id="Ylw-dW-E2P"/> <action selector="delecteSelectedGoods:" destination="4Ho-ZE-RT8" eventType="touchUpInside" id="Ylw-dW-E2P"/>
</connections> </connections>
</button> </button>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="请输入" textAlignment="center" minimumFontSize="17" id="3Ma-x4-wIO">
<rect key="frame" x="481" y="17" width="70" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<label opaque="NO" multipleTouchEnabled="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="合计金额:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="lfY-O6-zCQ">
<rect key="frame" x="594" y="21" width="73" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="highlightedColor"/>
</label>
</subviews> </subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view> </view>
...@@ -1964,6 +1976,7 @@ ...@@ -1964,6 +1976,7 @@
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="iPadPro"/> <simulatedScreenMetrics key="simulatedDestinationMetrics" type="iPadPro"/>
<connections> <connections>
<outlet property="allSelectedButton" destination="va8-YD-eVD" id="QFT-8I-gC3"/> <outlet property="allSelectedButton" destination="va8-YD-eVD" id="QFT-8I-gC3"/>
<outlet property="discountTextField" destination="3Ma-x4-wIO" id="KWE-H2-HVs"/>
<outlet property="settlementButton" destination="QOZ-rd-1Ea" id="eFY-bt-n2S"/> <outlet property="settlementButton" destination="QOZ-rd-1Ea" id="eFY-bt-n2S"/>
<outlet property="shoppingTableview" destination="RJW-eG-Q3P" id="M5W-yO-xaT"/> <outlet property="shoppingTableview" destination="RJW-eG-Q3P" id="M5W-yO-xaT"/>
<outlet property="totalpriceLabe" destination="SzO-sh-Q17" id="L5U-re-i18"/> <outlet property="totalpriceLabe" destination="SzO-sh-Q17" id="L5U-re-i18"/>
......
...@@ -98,6 +98,11 @@ ...@@ -98,6 +98,11 @@
*/ */
- (void)QueryShoppingCarNumber; - (void)QueryShoppingCarNumber;
/**
* 查询购物车商品
*/
- (void)queryShoppingCarGoods;
/** /**
* 系统提示框 * 系统提示框
......
...@@ -436,22 +436,27 @@ ...@@ -436,22 +436,27 @@
#pragma mark -查询购物车数量 #pragma mark -查询购物车数量
- (void)QueryShoppingCarNumber - (void)QueryShoppingCarNumber
{ {
WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(QUERYSHOPPINGBAGNUMBER),[Customermanager manager].model.fid] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(QUERYSHOPPINGBAGNUMBER),[Customermanager manager].model.fid] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
NSLog(@"更新购物车数量成功"); NSLog(@"更新购物车数量成功");
[[NSNotificationCenter defaultCenter]postNotificationName:REFRESHSHOPPINGCAR object:returnValue[@"data"]]; [[NSNotificationCenter defaultCenter]postNotificationName:REFRESHSHOPPINGCAR object:returnValue[@"data"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
[self RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[self ErrorMBProgressView:@"无网络"]; [weakSelf ErrorMBProgressView:@"无网络"];
} WithFailureBlock:^(id error) { } WithFailureBlock:^(NSError *error) {
NSLog(@"更新购物车数量失败"); NSLog(@"更新购物车数量失败");
[weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
} }
#pragma mark - 查询购物车商品
- (void)queryShoppingCarGoods
{
[[NSNotificationCenter defaultCenter] postNotificationName:SHOPPINGCARGOODS object:nil];
}
#pragma mark -系统提示框 #pragma mark -系统提示框
- (void)promptCustomerWithString:(NSString *)message - (void)promptCustomerWithString:(NSString *)message
...@@ -466,7 +471,6 @@ ...@@ -466,7 +471,6 @@
}); });
} }
#pragma mark -友好化时间 #pragma mark -友好化时间
+ (NSString *) compareCurrentTime:(NSString *)str + (NSString *) compareCurrentTime:(NSString *)str
{ {
......
...@@ -269,3 +269,8 @@ extern NSString *const ACTIVED; ...@@ -269,3 +269,8 @@ extern NSString *const ACTIVED;
* 京东卡状态<查看> * 京东卡状态<查看>
*/ */
extern NSString *const LOOKED; extern NSString *const LOOKED;
/**
* 更新购物车商品
*/
extern NSString *const SHOPPINGCARGOODS;
...@@ -269,6 +269,11 @@ NSString *const ACTIVED = @"actived"; ...@@ -269,6 +269,11 @@ NSString *const ACTIVED = @"actived";
*/ */
NSString *const LOOKED = @"looked"; NSString *const LOOKED = @"looked";
/**
* 更新购物车商品
*/
NSString *const SHOPPINGCARGOODS = @"shoppingCar";
......
...@@ -585,7 +585,7 @@ ...@@ -585,7 +585,7 @@
} }
#pragma mark -分享失败 #pragma mark -分享失败
- (void)CodeNotEqualZero:(NSString *)message - (void)CodeNotEqualZERO:(NSString *)message
{ {
[self ErrorMBProgressView:message]; [self ErrorMBProgressView:message];
} }
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
/** /**
* 0 * 0
*/ */
#define Zero 0 #define ZERO 0
/** /**
* 断网标示 * 断网标示
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
/** /**
* code不为0 * code不为0
*/ */
- (void)CodeNotEqualZero:(NSString *)message; - (void)CodeNotEqualZERO:(NSString *)message;
@end @end
......
...@@ -62,9 +62,9 @@ ...@@ -62,9 +62,9 @@
[weakSelf callSharePlatform:shareWeb withPlatformTag:sender withTitle:ShareTitle]; [weakSelf callSharePlatform:shareWeb withPlatformTag:sender withTitle:ShareTitle];
}else }else
{ {
if ([weakSelf.delegate respondsToSelector:@selector(CodeNotEqualZero:)]) { if ([weakSelf.delegate respondsToSelector:@selector(CodeNotEqualZERO:)]) {
[weakSelf.delegate CodeNotEqualZero:returnValue[@"message"]]; [weakSelf.delegate CodeNotEqualZERO:returnValue[@"message"]];
} }
} }
......
...@@ -272,9 +272,10 @@ ...@@ -272,9 +272,10 @@
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
} WithFailureBlock:^(id error) { [weakSelf ErrorMBProgressView:NETWORK];
[weakSelf ErrorMBProgressView:@"加入购物车失败"]; } WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
} }
...@@ -284,41 +285,25 @@ ...@@ -284,41 +285,25 @@
{ {
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"提示" message:message preferredStyle:UIAlertControllerStyleAlert]; UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"提示" message:message preferredStyle:UIAlertControllerStyleAlert];
[alertVC addAction:[UIAlertAction actionWithTitle:@"我知道了" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { [alertVC addAction:[UIAlertAction actionWithTitle:@"我知道了" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[alertVC dismissViewControllerAnimated:YES completion:nil]; [alertVC dismissViewControllerAnimated:YES completion:nil];
}]]; }]];
[self presentViewController:alertVC animated:YES completion:nil]; [self presentViewController:alertVC animated:YES completion:nil];
} }
#pragma mark -修改单个商品数量、价格
//#pragma mark -改变商品数量 - (void)changeGoodsNumber:(NSInteger)goodsNumber WithcostPrice:(CGFloat)costprice Withcellindex:(NSInteger)cellindex returnValue:(void (^)(id))result
//- (void)ChangeGoodsNumber:(NSInteger)goodsNumber WithcostPrice:(CGFloat)costprice Withcellindex:(NSInteger)cellindex returnValue:(void (^)(id))result
//{
// ShopcarModel *model = [self.datasArray objectAtIndex_opple:cellindex];
// //保存商品数量
// model.goodsNum = goodsNumber;
// //保存成交价格
// model.costPrice = [NSNumber numberWithFloat:costprice];
// [self CalculateSelectedGoodsAllprice];
//}
#pragma mark -改变商品数量
- (void)ChangeGoodsNumber:(NSInteger)goodsNumber WithcostPrice:(CGFloat)costprice Withcellindex:(NSInteger)cellindex returnValue:(void (^)(id))result
{ {
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
//保存商品数量 //保存商品数量
ShopcarModel *model = [self.datasArray objectAtIndex_opple:cellindex]; ShopcarModel *model = [self.datasArray objectAtIndex_opple:cellindex];
model.goodsNum = goodsNumber; model.goodsNum = goodsNumber;
// [self.shopResponseArray replaceObjectAtIndex:cellindex withObject:model];
//保存成交价格 //保存成交价格
ShopcarModel *Newmodel = [self.datasArray objectAtIndex_opple:cellindex]; model.costPrice = [NSNumber numberWithFloat:costprice];
Newmodel.costPrice = (NSDecimalNumber *)[NSDecimalNumber numberWithFloat:costprice];
// [self.shopResponseArray replaceObjectAtIndex:cellindex withObject:Newmodel];
//在服务器保存数量、成交价 //在服务器保存数量、成交价
//购物车ID //购物车ID
NSString *carid = [[self.datasArray objectAtIndex_opple:cellindex] fid]; NSString *carid = model.fid;
//商品id //商品id
NSString *goodsis = [[[self.datasArray objectAtIndex_opple:cellindex] goods] uuid]; NSString *goodsis = model.goodsId;
//成交价 //成交价
NSString *costpriceString = [NSString stringWithFormat:@"%.2f",costprice]; NSString *costpriceString = [NSString stringWithFormat:@"%.2f",costprice];
//商品数量 //商品数量
...@@ -329,7 +314,6 @@ ...@@ -329,7 +314,6 @@
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
result(returnValue);//提供是否支持修改的参数 result(returnValue);//提供是否支持修改的参数
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
NSLog(@"写入服务器成功");
[weakSelf CalculateSelectedGoodsAllprice]; [weakSelf CalculateSelectedGoodsAllprice];
[weakSelf QueryShoppingCarNumber]; [weakSelf QueryShoppingCarNumber];
}else{ }else{
...@@ -339,11 +323,11 @@ ...@@ -339,11 +323,11 @@
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:@"无网络"]; [weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(id error) { } WithFailureBlock:^(NSError *error) {
NSLog(@"写入服务器失败");
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
} }
......
This diff is collapsed.
...@@ -171,12 +171,49 @@ ...@@ -171,12 +171,49 @@
@end @end
@implementation OrderBill @implementation Draw
@synthesize datapage; @synthesize fid;
@synthesize order; @synthesize lotteryId;
@synthesize orderdetailList; @synthesize drawDate;
@synthesize consumer; @synthesize winnerId;
@synthesize employee; @synthesize award;
@synthesize orderNumber;
@synthesize state;
+(BOOL)propertyIsOptional:(NSString*)propertyName
{
return YES;
}
+(JSONKeyMapper*)keyMapper
{
return [[JSONKeyMapper alloc] initWithDictionary:@{
@"id": @"fid",
}];
}
@end
@implementation RsLotteryRequest
@synthesize guideIdEquals;
@synthesize page;
+(BOOL)propertyIsOptional:(NSString*)propertyName
{
return YES;
}
@end
@implementation OrderFilter
@synthesize resellerCodeEquals;
@synthesize orderStateEquals;
@synthesize consumerNameOrMobileEquals;
@synthesize consumerIdEquals;
@synthesize dp;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -195,6 +232,7 @@ ...@@ -195,6 +232,7 @@
@synthesize billType; @synthesize billType;
@synthesize billTitle; @synthesize billTitle;
@synthesize realAmount; @synthesize realAmount;
@synthesize draw;
@synthesize promotionGoods; @synthesize promotionGoods;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
...@@ -213,9 +251,10 @@ ...@@ -213,9 +251,10 @@
@end @end
@implementation PromotionGoods @implementation SceneCondition
@synthesize goods; @synthesize styleEquals;
@synthesize promotionNumber; @synthesize spaceEquals;
@synthesize page;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -237,8 +276,8 @@ ...@@ -237,8 +276,8 @@
@end @end
@implementation RsShippingAddrEntity @implementation DeleteCartRequest
@synthesize list; @synthesize cartIds;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -248,10 +287,9 @@ ...@@ -248,10 +287,9 @@
@end @end
@implementation SaveShoppingCartRequest @implementation ShopCartFilter
@synthesize consumerId; @synthesize consumerId;
@synthesize goodsId; @synthesize dp;
@synthesize count;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -261,9 +299,9 @@ ...@@ -261,9 +299,9 @@
@end @end
@implementation ShopCartFilter @implementation RsShareResponse
@synthesize consumerId; @synthesize shareId;
@synthesize dp; @synthesize url;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -273,22 +311,19 @@ ...@@ -273,22 +311,19 @@
@end @end
@implementation TOApplyBillEntity @implementation TOCommissionHistEntity
@synthesize fid; @synthesize fid;
@synthesize createName; @synthesize createName;
@synthesize createBy;
@synthesize createDate; @synthesize createDate;
@synthesize updateName; @synthesize resellerCode;
@synthesize updateBy; @synthesize employeeId;
@synthesize updateDate; @synthesize orderId;
@synthesize sysOrgCode; @synthesize amount;
@synthesize billNumber; @synthesize afteramount;
@synthesize guideId; @synthesize remark;
@synthesize guideName; @synthesize orderNumber;
@synthesize applyMoney; @synthesize employeeName;
@synthesize beforeMoney; @synthesize state;
@synthesize afterMoney;
@synthesize billStates;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -306,21 +341,21 @@ ...@@ -306,21 +341,21 @@
@end @end
@implementation TOConsumerEntity @implementation TODrawEntity
@synthesize fid; @synthesize fid;
@synthesize createName; @synthesize createName;
@synthesize createBy; @synthesize createBy;
@synthesize createDate; @synthesize createDate;
@synthesize updateName;
@synthesize updateBy;
@synthesize updateDate;
@synthesize sysOrgCode; @synthesize sysOrgCode;
@synthesize name; @synthesize lotteryId;
@synthesize mobile; @synthesize drawDate;
@synthesize province; @synthesize winnerId;
@synthesize city; @synthesize award;
@synthesize country; @synthesize orderNumber;
@synthesize address; @synthesize state;
@synthesize picture;
@synthesize lastVisitedTime;
@synthesize company;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -827,19 +862,21 @@ NSString * const SORTDIRECTION_DESC = @"desc"; ...@@ -827,19 +862,21 @@ NSString * const SORTDIRECTION_DESC = @"desc";
@end @end
@implementation TOCommissionHistEntity @implementation TOConsumerEntity
@synthesize fid; @synthesize fid;
@synthesize createName; @synthesize createName;
@synthesize createBy;
@synthesize createDate; @synthesize createDate;
@synthesize resellerCode; @synthesize sysOrgCode;
@synthesize employeeId; @synthesize name;
@synthesize orderId; @synthesize mobile;
@synthesize amount; @synthesize province;
@synthesize afteramount; @synthesize city;
@synthesize remark; @synthesize country;
@synthesize orderNumber; @synthesize address;
@synthesize employeeName; @synthesize picture;
@synthesize state; @synthesize lastVisitedTime;
@synthesize company;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -857,9 +894,22 @@ NSString * const SORTDIRECTION_DESC = @"desc"; ...@@ -857,9 +894,22 @@ NSString * const SORTDIRECTION_DESC = @"desc";
@end @end
@implementation RsShareResponse @implementation TOApplyBillEntity
@synthesize shareId; @synthesize fid;
@synthesize url; @synthesize createName;
@synthesize createBy;
@synthesize createDate;
@synthesize updateName;
@synthesize updateBy;
@synthesize updateDate;
@synthesize sysOrgCode;
@synthesize billNumber;
@synthesize guideId;
@synthesize guideName;
@synthesize applyMoney;
@synthesize beforeMoney;
@synthesize afterMoney;
@synthesize billStates;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -867,10 +917,20 @@ NSString * const SORTDIRECTION_DESC = @"desc"; ...@@ -867,10 +917,20 @@ NSString * const SORTDIRECTION_DESC = @"desc";
} }
+(JSONKeyMapper*)keyMapper
{
return [[JSONKeyMapper alloc] initWithDictionary:@{
@"id": @"fid",
}];
}
@end @end
@implementation DeleteCartRequest @implementation SaveShoppingCartRequest
@synthesize cartIds; @synthesize consumerId;
@synthesize goodsId;
@synthesize count;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -880,10 +940,8 @@ NSString * const SORTDIRECTION_DESC = @"desc"; ...@@ -880,10 +940,8 @@ NSString * const SORTDIRECTION_DESC = @"desc";
@end @end
@implementation SceneCondition @implementation RsShippingAddrEntity
@synthesize styleEquals; @synthesize list;
@synthesize spaceEquals;
@synthesize page;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -893,12 +951,24 @@ NSString * const SORTDIRECTION_DESC = @"desc"; ...@@ -893,12 +951,24 @@ NSString * const SORTDIRECTION_DESC = @"desc";
@end @end
@implementation OrderFilter @implementation PromotionGoods
@synthesize resellerCodeEquals; @synthesize goods;
@synthesize orderStateEquals; @synthesize promotionNumber;
@synthesize consumerNameOrMobileEquals;
@synthesize consumerIdEquals; +(BOOL)propertyIsOptional:(NSString*)propertyName
@synthesize dp; {
return YES;
}
@end
@implementation OrderBill
@synthesize datapage;
@synthesize order;
@synthesize orderdetailList;
@synthesize consumer;
@synthesize employee;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -1097,6 +1167,17 @@ NSString * const SORTDIRECTION_DESC = @"desc"; ...@@ -1097,6 +1167,17 @@ NSString * const SORTDIRECTION_DESC = @"desc";
} }
@end
@implementation OrderResponse
@synthesize orderBillList;
+(BOOL)propertyIsOptional:(NSString*)propertyName
{
return YES;
}
@end @end
@implementation TSUserOrg @implementation TSUserOrg
...@@ -1111,8 +1192,8 @@ NSString * const SORTDIRECTION_DESC = @"desc"; ...@@ -1111,8 +1192,8 @@ NSString * const SORTDIRECTION_DESC = @"desc";
@end @end
@implementation SceneResponse @implementation ShopCartResponse
@synthesize list; @synthesize shopcart;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -1122,8 +1203,8 @@ NSString * const SORTDIRECTION_DESC = @"desc"; ...@@ -1122,8 +1203,8 @@ NSString * const SORTDIRECTION_DESC = @"desc";
@end @end
@implementation ShopCartResponse @implementation SceneResponse
@synthesize shopcart; @synthesize list;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -1133,8 +1214,8 @@ NSString * const SORTDIRECTION_DESC = @"desc"; ...@@ -1133,8 +1214,8 @@ NSString * const SORTDIRECTION_DESC = @"desc";
@end @end
@implementation OrderResponse @implementation RsLotteryResponse
@synthesize orderBillList; @synthesize list;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
......
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