Commit 6009f25a authored by 曹云霄's avatar 曹云霄

debug

parent 29f493ff
...@@ -519,7 +519,6 @@ ...@@ -519,7 +519,6 @@
#pragma mark -筛选 #pragma mark -筛选
- (void)ScreeningButtonClick - (void)ScreeningButtonClick
{ {
//
// ExperienceCentreViewController *ExperienceCenter = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"ExperienceCentre"]; // ExperienceCentreViewController *ExperienceCenter = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"ExperienceCentre"];
// ExperienceCenter.modalPresentationStyle = UIModalPresentationOverFullScreen; // ExperienceCenter.modalPresentationStyle = UIModalPresentationOverFullScreen;
// UIPopoverPresentationController *popover = ExperienceCenter.popoverPresentationController; // UIPopoverPresentationController *popover = ExperienceCenter.popoverPresentationController;
......
...@@ -136,7 +136,6 @@ ...@@ -136,7 +136,6 @@
page.page = self.indexPage; page.page = self.indexPage;
page.rows = KROWS; page.rows = KROWS;
self.conditionModel.page = page; self.conditionModel.page = page;
[self.seceneLibararyCollectionView.mj_footer resetNoMoreData]; [self.seceneLibararyCollectionView.mj_footer resetNoMoreData];
[self getSceneLibrarydatas:self.conditionModel isRemove:YES]; [self getSceneLibrarydatas:self.conditionModel isRemove:YES];
}]; }];
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
@protocol ChangeGoodsNumberDelegate <NSObject> @protocol ChangeGoodsNumberDelegate <NSObject>
@optional
/** /**
* 当前商品数量、成交价 * 当前商品数量、成交价
*/ */
......
...@@ -90,8 +90,7 @@ ...@@ -90,8 +90,7 @@
break; break;
} }
//改变价格 //改变价格
self.productPriceLabe.text = [NSString stringWithFormat:@"¥%.2f",[self.goodsNumbersLabe.text integerValue]*[_model.costPrice floatValue]]; self.productPriceLabe.text = [NSString stringWithFormat:@"¥%.2f",[self.goodsNumbersLabe.text integerValue]*[self.clinchTextfield.text floatValue]];
// _model.costPrice = [NSNumber numberWithFloat:[self.clinchTextfield.text floatValue]];
if ([self.delegate respondsToSelector:@selector(ChangeGoodsNumber:WithcostPrice:Withcellindex:)]) { if ([self.delegate respondsToSelector:@selector(ChangeGoodsNumber:WithcostPrice:Withcellindex:)]) {
[self.delegate ChangeGoodsNumber:[self.goodsNumbersLabe.text intValue] WithcostPrice:[self.clinchTextfield.text floatValue]Withcellindex:_cellindex]; [self.delegate ChangeGoodsNumber:[self.goodsNumbersLabe.text intValue] WithcostPrice:[self.clinchTextfield.text floatValue]Withcellindex:_cellindex];
} }
......
...@@ -366,6 +366,9 @@ ...@@ -366,6 +366,9 @@
[self.shopResponseArray removeObject:model]; [self.shopResponseArray removeObject:model];
} }
[self.shoppingTableview deleteRowsAtIndexPaths:delecteArray withRowAnimation:UITableViewRowAnimationLeft]; [self.shoppingTableview deleteRowsAtIndexPaths:delecteArray withRowAnimation:UITableViewRowAnimationLeft];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.shoppingTableview reloadData];
});
[self SuccessMBProgressView:@"删除成功"]; [self SuccessMBProgressView:@"删除成功"];
[self CalculateSelectedGoodsAllprice]; [self CalculateSelectedGoodsAllprice];
self.allSelectedButton.selected = NO; self.allSelectedButton.selected = NO;
...@@ -428,7 +431,6 @@ ...@@ -428,7 +431,6 @@
NSLog(@"写入服务器失败"); NSLog(@"写入服务器失败");
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
}]; }];
} }
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#import "SearchViewController.h" #import "SearchViewController.h"
#import "BaseViewController.h" #import "BaseViewController.h"
#import "QRViewController.h" #import "QRViewController.h"
#import "ExperienceCentreViewController.h"
@interface CustomTabbarController ()<TabbarButtonClickdelegate,ChangpasswordDelegate,CancelButtondelegate,UITextFieldDelegate> @interface CustomTabbarController ()<TabbarButtonClickdelegate,ChangpasswordDelegate,CancelButtondelegate,UITextFieldDelegate>
...@@ -321,14 +322,34 @@ ...@@ -321,14 +322,34 @@
#pragma mark -推出体验中心控制器 #pragma mark -推出体验中心控制器
- (void)ShowFollowHeart:(NSNotification *)objc - (void)ShowFollowHeart:(NSNotification *)objc
{ {
if (![Shoppersmanager manager].currentCustomer) {
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view.window animated:YES];
hud.labelText = @"必须设置当前客户才能访问购物车";
hud.margin = 10.f;
hud.color = [[UIColor blackColor] colorWithAlphaComponent:0.5];
hud.minSize = CGSizeMake(200, 50);
hud.animationType = MBProgressHUDAnimationZoom;
hud.mode = MBProgressHUDModeText;
hud.removeFromSuperViewOnHide = YES;
[hud hide:YES afterDelay:1.0f];
}else
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"StoryboardwithCYX" bundle:nil]; UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"StoryboardwithCYX" bundle:nil];
FollowHeartViewController *followVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:3]]; FollowHeartViewController *followVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:3]];
[self presentViewController:followVC animated:YES completion:nil]; [self presentViewController:followVC animated:YES completion:nil];
// ExperienceCentreViewController *ExperienceCenter = [storyboard instantiateViewControllerWithIdentifier:@"ExperienceCentre"];
// ExperienceCenter.modalPresentationStyle = UIModalPresentationOverFullScreen;
// UIPopoverPresentationController *popover = ExperienceCenter.popoverPresentationController;
// popover.sourceView = ExperienceCenter.view;
// [self presentViewController:ExperienceCenter animated:YES completion:nil];
}
} }
#pragma mark -禁止跳转
//- (void)
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
......
...@@ -159,6 +159,7 @@ ...@@ -159,6 +159,7 @@
[[NSUserDefaults standardUserDefaults] setObject:self.userName.text forKey:USERNAME]; [[NSUserDefaults standardUserDefaults] setObject:self.userName.text forKey:USERNAME];
[[NSUserDefaults standardUserDefaults] setObject:self.passWord.text forKey:PASSWORD]; [[NSUserDefaults standardUserDefaults] setObject:self.passWord.text forKey:PASSWORD];
[[NSUserDefaults standardUserDefaults] synchronize]; [[NSUserDefaults standardUserDefaults] synchronize];
[self dismissViewControllerAnimated:YES completion:nil];
}else }else
{ {
......
...@@ -67,6 +67,9 @@ ...@@ -67,6 +67,9 @@
2942F8A61CDD80C2005B377E /* authenticateView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2942F8A51CDD80C2005B377E /* authenticateView.m */; }; 2942F8A61CDD80C2005B377E /* authenticateView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2942F8A51CDD80C2005B377E /* authenticateView.m */; };
2942F8A81CDD80CE005B377E /* authenticateView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2942F8A71CDD80CE005B377E /* authenticateView.xib */; }; 2942F8A81CDD80CE005B377E /* authenticateView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2942F8A71CDD80CE005B377E /* authenticateView.xib */; };
29498C541D050DFC004FA79B /* UIImagePickerController+SupportDirection.m in Sources */ = {isa = PBXBuildFile; fileRef = 29498C531D050DFC004FA79B /* UIImagePickerController+SupportDirection.m */; }; 29498C541D050DFC004FA79B /* UIImagePickerController+SupportDirection.m in Sources */ = {isa = PBXBuildFile; fileRef = 29498C531D050DFC004FA79B /* UIImagePickerController+SupportDirection.m */; };
29498C5A1D051C3F004FA79B /* HelpController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29498C591D051C3F004FA79B /* HelpController.m */; };
29498C5D1D053B2C004FA79B /* ShoppingBagViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29498C5C1D053B2C004FA79B /* ShoppingBagViewController.m */; };
29498C601D053B7C004FA79B /* ShoppingBagTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29498C5F1D053B7C004FA79B /* ShoppingBagTableViewCell.m */; };
2949BABD1CD2EFA00049385A /* InformationTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2949BABC1CD2EFA00049385A /* InformationTableViewCell.m */; }; 2949BABD1CD2EFA00049385A /* InformationTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2949BABC1CD2EFA00049385A /* InformationTableViewCell.m */; };
2949BAC21CD3055A0049385A /* MMExampleDrawerVisualStateManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 2949BAC11CD3055A0049385A /* MMExampleDrawerVisualStateManager.m */; }; 2949BAC21CD3055A0049385A /* MMExampleDrawerVisualStateManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 2949BAC11CD3055A0049385A /* MMExampleDrawerVisualStateManager.m */; };
294CF0EC1CEDCF480055F1D8 /* PromptinformationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 294CF0EB1CEDCF480055F1D8 /* PromptinformationView.m */; }; 294CF0EC1CEDCF480055F1D8 /* PromptinformationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 294CF0EB1CEDCF480055F1D8 /* PromptinformationView.m */; };
...@@ -276,6 +279,12 @@ ...@@ -276,6 +279,12 @@
2942F8A71CDD80CE005B377E /* authenticateView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = authenticateView.xib; sourceTree = "<group>"; }; 2942F8A71CDD80CE005B377E /* authenticateView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = authenticateView.xib; sourceTree = "<group>"; };
29498C521D050DFC004FA79B /* UIImagePickerController+SupportDirection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImagePickerController+SupportDirection.h"; sourceTree = "<group>"; }; 29498C521D050DFC004FA79B /* UIImagePickerController+SupportDirection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImagePickerController+SupportDirection.h"; sourceTree = "<group>"; };
29498C531D050DFC004FA79B /* UIImagePickerController+SupportDirection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImagePickerController+SupportDirection.m"; sourceTree = "<group>"; }; 29498C531D050DFC004FA79B /* UIImagePickerController+SupportDirection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImagePickerController+SupportDirection.m"; sourceTree = "<group>"; };
29498C581D051C3F004FA79B /* HelpController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HelpController.h; sourceTree = "<group>"; };
29498C591D051C3F004FA79B /* HelpController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HelpController.m; sourceTree = "<group>"; };
29498C5B1D053B2C004FA79B /* ShoppingBagViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShoppingBagViewController.h; sourceTree = "<group>"; };
29498C5C1D053B2C004FA79B /* ShoppingBagViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShoppingBagViewController.m; sourceTree = "<group>"; };
29498C5E1D053B7C004FA79B /* ShoppingBagTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShoppingBagTableViewCell.h; sourceTree = "<group>"; };
29498C5F1D053B7C004FA79B /* ShoppingBagTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShoppingBagTableViewCell.m; sourceTree = "<group>"; };
2949BABB1CD2EFA00049385A /* InformationTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InformationTableViewCell.h; sourceTree = "<group>"; }; 2949BABB1CD2EFA00049385A /* InformationTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InformationTableViewCell.h; sourceTree = "<group>"; };
2949BABC1CD2EFA00049385A /* InformationTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InformationTableViewCell.m; sourceTree = "<group>"; }; 2949BABC1CD2EFA00049385A /* InformationTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InformationTableViewCell.m; sourceTree = "<group>"; };
2949BAC01CD3055A0049385A /* MMExampleDrawerVisualStateManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMExampleDrawerVisualStateManager.h; sourceTree = "<group>"; }; 2949BAC01CD3055A0049385A /* MMExampleDrawerVisualStateManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMExampleDrawerVisualStateManager.h; sourceTree = "<group>"; };
...@@ -810,6 +819,8 @@ ...@@ -810,6 +819,8 @@
2936F28E1D0141FD007CA67C /* ProductScreeningTableViewCell.m */, 2936F28E1D0141FD007CA67C /* ProductScreeningTableViewCell.m */,
2936F2941D017BBD007CA67C /* GoodsImageView.h */, 2936F2941D017BBD007CA67C /* GoodsImageView.h */,
2936F2951D017BBD007CA67C /* GoodsImageView.m */, 2936F2951D017BBD007CA67C /* GoodsImageView.m */,
29498C5E1D053B7C004FA79B /* ShoppingBagTableViewCell.h */,
29498C5F1D053B7C004FA79B /* ShoppingBagTableViewCell.m */,
); );
name = view; name = view;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1037,6 +1048,10 @@ ...@@ -1037,6 +1048,10 @@
2936F2971D01868E007CA67C /* ShareGoodsViewController.h */, 2936F2971D01868E007CA67C /* ShareGoodsViewController.h */,
2936F2981D01868E007CA67C /* ShareGoodsViewController.m */, 2936F2981D01868E007CA67C /* ShareGoodsViewController.m */,
2936F2991D01868E007CA67C /* ShareGoodsViewController.xib */, 2936F2991D01868E007CA67C /* ShareGoodsViewController.xib */,
29498C581D051C3F004FA79B /* HelpController.h */,
29498C591D051C3F004FA79B /* HelpController.m */,
29498C5B1D053B2C004FA79B /* ShoppingBagViewController.h */,
29498C5C1D053B2C004FA79B /* ShoppingBagViewController.m */,
); );
name = Controller; name = Controller;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1649,6 +1664,7 @@ ...@@ -1649,6 +1664,7 @@
04F662171CFB9F4A00384248 /* HelpViewController.m in Sources */, 04F662171CFB9F4A00384248 /* HelpViewController.m in Sources */,
2928F8421CD0ABAC0036D761 /* ShoppingViewController.m in Sources */, 2928F8421CD0ABAC0036D761 /* ShoppingViewController.m in Sources */,
29698D611CE2C11500D72CE7 /* SettlementViewController.m in Sources */, 29698D611CE2C11500D72CE7 /* SettlementViewController.m in Sources */,
29498C5D1D053B2C004FA79B /* ShoppingBagViewController.m in Sources */,
291D6A5C1CFFDCCA007891AE /* SceneListModel.m in Sources */, 291D6A5C1CFFDCCA007891AE /* SceneListModel.m in Sources */,
299876331CD997DF00C90D0A /* OrderInformationTableViewCell.m in Sources */, 299876331CD997DF00C90D0A /* OrderInformationTableViewCell.m in Sources */,
29CB35421CFF0FB60061A5F3 /* ScreeningCollectionViewCell.m in Sources */, 29CB35421CFF0FB60061A5F3 /* ScreeningCollectionViewCell.m in Sources */,
...@@ -1675,6 +1691,7 @@ ...@@ -1675,6 +1691,7 @@
29CCA43C1CF7ED6100BC19DD /* SelectedTableViewCell.m in Sources */, 29CCA43C1CF7ED6100BC19DD /* SelectedTableViewCell.m in Sources */,
294CF0EC1CEDCF480055F1D8 /* PromptinformationView.m in Sources */, 294CF0EC1CEDCF480055F1D8 /* PromptinformationView.m in Sources */,
290887131CE5DF16000B7097 /* ShopcarModel.m in Sources */, 290887131CE5DF16000B7097 /* ShopcarModel.m in Sources */,
29498C5A1D051C3F004FA79B /* HelpController.m in Sources */,
060A22311CFC518E00945BA4 /* CustomTOGoodsEntity.m in Sources */, 060A22311CFC518E00945BA4 /* CustomTOGoodsEntity.m in Sources */,
04FCB1A41CF60A8F0056093B /* DeviceDirectionManager.m in Sources */, 04FCB1A41CF60A8F0056093B /* DeviceDirectionManager.m in Sources */,
29BB27681CD9D38E009A0813 /* AllpriceTableViewCell.m in Sources */, 29BB27681CD9D38E009A0813 /* AllpriceTableViewCell.m in Sources */,
...@@ -1686,6 +1703,7 @@ ...@@ -1686,6 +1703,7 @@
04F9EE1B1CF22B5900BD729F /* ShoppingCell.m in Sources */, 04F9EE1B1CF22B5900BD729F /* ShoppingCell.m in Sources */,
29360C2F1CDDC47E002A5D89 /* ScreeningView.m in Sources */, 29360C2F1CDDC47E002A5D89 /* ScreeningView.m in Sources */,
2985AEA21CE72F1500704C91 /* NSDictionary+ZXPUnicode.m in Sources */, 2985AEA21CE72F1500704C91 /* NSDictionary+ZXPUnicode.m in Sources */,
29498C601D053B7C004FA79B /* ShoppingBagTableViewCell.m in Sources */,
29EAAE9C1CDC74CA00C4DBA2 /* AllCustomerViewController.m in Sources */, 29EAAE9C1CDC74CA00C4DBA2 /* AllCustomerViewController.m in Sources */,
04A14A2B1CE0FC7F00DAD5F3 /* FootSubView.m in Sources */, 04A14A2B1CE0FC7F00DAD5F3 /* FootSubView.m in Sources */,
2933934F1CD3158B000D997B /* instructionsLabe.m in Sources */, 2933934F1CD3158B000D997B /* instructionsLabe.m in Sources */,
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.0</string> <string>1.0.1</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleURLTypes</key> <key>CFBundleURLTypes</key>
......
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
#import "GoodsImageView.h" #import "GoodsImageView.h"
#import "ShareGoodsViewController.h" #import "ShareGoodsViewController.h"
#import "DeviceDirectionManager.h" #import "DeviceDirectionManager.h"
#import "HelpController.h"
#import "ShoppingBagViewController.h"
#define LEFTWIDTH 100 #define LEFTWIDTH 100
...@@ -170,7 +172,18 @@ ...@@ -170,7 +172,18 @@
GoodsImageView *imageView = [[GoodsImageView alloc]initWithFrame:cellRect]; GoodsImageView *imageView = [[GoodsImageView alloc]initWithFrame:cellRect];
imageView.model = model; imageView.model = model;
[imageView setDelectedBlock:^(TOGoodsEntityModel *delectedModel) { [imageView setDelectedBlock:^(TOGoodsEntityModel *delectedModel) {
//删除先判断数量
for (TOGoodsEntityModel *newModel in self.shareGoodsArray) {
if ([newModel.fid isEqualToString:delectedModel.fid]) {
if (newModel.goodsNumber <= 1) {
[self.shareGoodsArray removeObject:delectedModel]; [self.shareGoodsArray removeObject:delectedModel];
}else
{
newModel.goodsNumber --;
}
break;
}
}
}]; }];
imageView.userInteractionEnabled = YES; imageView.userInteractionEnabled = YES;
[UIView animateWithDuration:0.5 animations:^{ [UIView animateWithDuration:0.5 animations:^{
...@@ -181,7 +194,19 @@ ...@@ -181,7 +194,19 @@
model.isSelectedState = NO; model.isSelectedState = NO;
} }
model.isSelectedState = YES; model.isSelectedState = YES;
//判断选中的商品是否已经存在
if ([self.shareGoodsArray containsObject:model]) {
for (TOGoodsEntityModel *newModel in self.shareGoodsArray) {
if ([newModel.fid isEqualToString:model.fid]) {
newModel.goodsNumber ++;
break;
}
}
}else
{
[self.shareGoodsArray addObject:model]; [self.shareGoodsArray addObject:model];
}
NSArray *imags = [model.pictures componentsSeparatedByString:@","]; NSArray *imags = [model.pictures componentsSeparatedByString:@","];
[imageView sd_setImageWithURL:[NSURL URLWithString:[imags firstObject]] placeholderImage:REPLACEIMAGE]; [imageView sd_setImageWithURL:[NSURL URLWithString:[imags firstObject]] placeholderImage:REPLACEIMAGE];
[self.sceneBackView addSubview:imageView]; [self.sceneBackView addSubview:imageView];
...@@ -201,7 +226,16 @@ ...@@ -201,7 +226,16 @@
#pragma mark -购物袋 #pragma mark -购物袋
- (IBAction)ShoppingBagButtonClickAction:(UIButton *)sender { - (IBAction)ShoppingBagButtonClickAction:(UIButton *)sender {
sender.selected = YES;
ShoppingBagViewController *shoppingBag = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"shoppingbagController"];
[shoppingBag setDismissBlock:^{
sender.selected = NO;
}];
shoppingBag.modalPresentationStyle = UIModalPresentationOverFullScreen;
UIPopoverPresentationController *pop = shoppingBag.popoverPresentationController;
pop.sourceView = shoppingBag.view;
shoppingBag.datasArray = self.shareGoodsArray;
[self presentViewController:shoppingBag animated:YES completion:nil];
} }
#pragma mark -分享 #pragma mark -分享
...@@ -223,12 +257,12 @@ ...@@ -223,12 +257,12 @@
popover.sourceView = shareController.view; popover.sourceView = shareController.view;
popover.sourceRect = CGRectMake(sender.mj_x, sender.mj_y-30, sender.mj_w, sender.mj_h); popover.sourceRect = CGRectMake(sender.mj_x, sender.mj_y-30, sender.mj_w, sender.mj_h);
[self presentViewController:shareController animated:YES completion:nil]; [self presentViewController:shareController animated:YES completion:nil];
} }
#pragma mark -拍照 #pragma mark -拍照
- (IBAction)TakingPhotoButtonClickAction:(UIButton *)sender { - (IBAction)TakingPhotoButtonClickAction:(UIButton *)sender {
sender.selected = YES;
UIAlertController *alertView = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleAlert]; UIAlertController *alertView = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleAlert];
UIImagePickerController *PcCamera = [[UIImagePickerController alloc]init]; UIImagePickerController *PcCamera = [[UIImagePickerController alloc]init];
PcCamera.delegate = self; PcCamera.delegate = self;
...@@ -243,6 +277,7 @@ ...@@ -243,6 +277,7 @@
else else
{ {
[self ErrorMBProgressView:@"相机无法使用"]; [self ErrorMBProgressView:@"相机无法使用"];
sender.selected = NO;
} }
}]]; }]];
[alertView addAction:[UIAlertAction actionWithTitle:@"从相册选择" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { [alertView addAction:[UIAlertAction actionWithTitle:@"从相册选择" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
...@@ -255,9 +290,11 @@ ...@@ -255,9 +290,11 @@
else else
{ {
[self ErrorMBProgressView:@"相册无法打开"]; [self ErrorMBProgressView:@"相册无法打开"];
sender.selected = NO;
} }
}]]; }]];
[alertView addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { [alertView addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
self.takingPicturesButton.selected = NO;
[alertView dismissViewControllerAnimated:YES completion:nil]; [alertView dismissViewControllerAnimated:YES completion:nil];
}]]; }]];
[self presentViewController:alertView animated:YES completion:nil]; [self presentViewController:alertView animated:YES completion:nil];
...@@ -270,21 +307,10 @@ ...@@ -270,21 +307,10 @@
[self dismissViewControllerAnimated:YES completion:nil]; [self dismissViewControllerAnimated:YES completion:nil];
UIImage *Headimage = [info objectForKey:UIImagePickerControllerOriginalImage]; UIImage *Headimage = [info objectForKey:UIImagePickerControllerOriginalImage];
self.sceneImageView.image = Headimage; self.sceneImageView.image = Headimage;
self.takingPicturesButton.selected = NO;
} }
#pragma mark -截屏 #pragma mark -截屏
- (UIImage *)capture - (UIImage *)capture
{ {
...@@ -299,6 +325,7 @@ ...@@ -299,6 +325,7 @@
return img; return img;
} }
#pragma mark -全屏 #pragma mark -全屏
- (IBAction)AmplificationButtonClickAction:(UIButton *)sender { - (IBAction)AmplificationButtonClickAction:(UIButton *)sender {
...@@ -340,6 +367,27 @@ ...@@ -340,6 +367,27 @@
#pragma mark -帮助 #pragma mark -帮助
- (IBAction)HelpButtonClickAction:(UIButton *)sender { - (IBAction)HelpButtonClickAction:(UIButton *)sender {
sender.selected = YES;
HelpController *helpView = [[HelpController alloc]init];
helpView.backButtonPoint = self.returnButton.mj_origin;
helpView.shoppingbagPoint = self.shoppingbagButton.mj_origin;
helpView.sharePoint = self.shareButton.mj_origin;
helpView.photoPoint = self.takingPicturesButton.mj_origin;
helpView.fullScreenPoint = self.amplificationButton.mj_origin;
helpView.helpPoint = self.helpButton.mj_origin;
helpView.scenePoint = self.sceneSelectedButton.center;
helpView.productPoint = self.productSelectedButton.center;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(dismissAction:)];
[helpView.view addGestureRecognizer:tap];
[self.view addSubview:helpView.view];
}
#pragma mark -销毁
- (void)dismissAction:(UITapGestureRecognizer *)tap
{
self.helpButton.selected = NO;
[tap.view removeFromSuperview];
} }
...@@ -347,9 +395,14 @@ ...@@ -347,9 +395,14 @@
#pragma mark -场景筛选 #pragma mark -场景筛选
- (IBAction)SceneSelectedButtonClickAction:(UIButton *)sender { - (IBAction)SceneSelectedButtonClickAction:(UIButton *)sender {
sender.selected = YES;
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"SCENE"]; [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"SCENE"];
SceneViewController *sceneVC = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"SceneController"]; SceneViewController *sceneVC = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"SceneController"];
[sceneVC setDismissBlock:^{
sender.selected = NO;
}];
sceneVC.view.backgroundColor = [UIColor clearColor]; sceneVC.view.backgroundColor = [UIColor clearColor];
sceneVC.titleLabe.text = @"选择场景";
sceneVC.searchBackView.hidden = YES; sceneVC.searchBackView.hidden = YES;
sceneVC.materialButton.hidden = YES; sceneVC.materialButton.hidden = YES;
sceneVC.priceButton.hidden = YES; sceneVC.priceButton.hidden = YES;
...@@ -365,9 +418,14 @@ ...@@ -365,9 +418,14 @@
#pragma mark -产品筛选 #pragma mark -产品筛选
- (IBAction)ProductSelectedButtonClickAction:(UIButton *)sender { - (IBAction)ProductSelectedButtonClickAction:(UIButton *)sender {
sender.selected = YES;
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"SCENE"]; [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"SCENE"];
SceneViewController *sceneVC = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"SceneController"]; SceneViewController *sceneVC = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"SceneController"];
[sceneVC setDismissBlock:^{
sender.selected = NO;
}];
sceneVC.view.backgroundColor = [UIColor clearColor]; sceneVC.view.backgroundColor = [UIColor clearColor];
sceneVC.titleLabe.text = @"选择商品";
sceneVC.searchBackView.hidden = NO; sceneVC.searchBackView.hidden = NO;
sceneVC.materialButton.hidden = NO; sceneVC.materialButton.hidden = NO;
sceneVC.priceButton.hidden = NO; sceneVC.priceButton.hidden = NO;
...@@ -468,6 +526,12 @@ ...@@ -468,6 +526,12 @@
}); });
} }
#pragma mark -分享失败
- (void)CodeNotEqualZero:(NSString *)message
{
[self ErrorMBProgressView:message];
}
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
......
...@@ -69,10 +69,12 @@ ...@@ -69,10 +69,12 @@
#pragma mark -长按 #pragma mark -长按
- (void)LongPressAction:(UILongPressGestureRecognizer *)longPress - (void)LongPressAction:(UILongPressGestureRecognizer *)longPress
{ {
if (longPress.state == UIGestureRecognizerStateBegan) {
if (self.delectedBlock) { if (self.delectedBlock) {
self.delectedBlock(self.model); self.delectedBlock(self.model);
} }
[self removeFromSuperview]; [self removeFromSuperview];
}
} }
......
//
// HelpController.h
// Lighting
//
// Created by 曹云霄 on 16/6/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface HelpController : BaseViewController
/**
* 返回按钮
*/
@property (nonatomic,assign) CGPoint backButtonPoint;
/**
* 购物袋
*/
@property (nonatomic,assign) CGPoint shoppingbagPoint;
/**
* 分享
*/
@property (nonatomic,assign) CGPoint sharePoint;
/**
* 相机
*/
@property (nonatomic,assign) CGPoint photoPoint;
/**
* 全屏
*/
@property (nonatomic,assign) CGPoint fullScreenPoint;
/**
* 帮助
*
*/
@property (nonatomic,assign) CGPoint helpPoint;
/**
* 场景
*/
@property (nonatomic,assign) CGPoint scenePoint;
/**
* 产品
*/
@property (nonatomic,assign) CGPoint productPoint;
@end
//
// HelpController.m
// Lighting
//
// Created by 曹云霄 on 16/6/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "HelpController.h"
@interface HelpController ()<UIGestureRecognizerDelegate>
/**
* 帮助文本
*/
@property (nonatomic,strong) NSArray *helpTitleArray;
@end
@implementation HelpController
- (NSArray *)helpTitleArray
{
if (!_helpTitleArray) {
_helpTitleArray = [NSArray arrayWithObjects:@"返回",@"添加至购物袋",@"分享方案",@"自定义场景",@"全屏",@"帮助",@"选择场景",@"选择产品", nil];
}
return _helpTitleArray;
}
- (void)viewDidLoad {
[super viewDidLoad];
[self uiConfigAction];
}
#pragma mark -UI
- (void)uiConfigAction
{
self.view.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
for (int i=0; i<self.helpTitleArray.count; i++) {
UIButton *helpButton = [UIButton buttonWithType:UIButtonTypeCustom];
UIImage *helpImage = [TCImage(@"lefttool1") resizableImageWithCapInsets:UIEdgeInsetsMake(30, 30, 30, 30) resizingMode:UIImageResizingModeStretch];
[helpButton setBackgroundImage:helpImage forState:UIControlStateNormal];
[helpButton setTitleColor:kMainBlueColor forState:UIControlStateNormal];
NSString *content = [self.helpTitleArray objectAtIndex_opple:i];
[helpButton setTitle:content forState:UIControlStateNormal];
helpButton.titleLabel.font = [UIFont systemFontOfSize:15];
[self.view addSubview:helpButton];
switch (i) {
case 0://返回
{
helpButton.frame = CGRectMake(self.backButtonPoint.x+50, self.backButtonPoint.y, [self calculateStringLength:content], 50);
}
break;
case 1://添加至购物车
{
helpButton.frame = CGRectMake(self.shoppingbagPoint.x+50, self.shoppingbagPoint.y, [self calculateStringLength:content], 50);
}
break;
case 2://分享方案
{
helpButton.frame = CGRectMake(self.sharePoint.x+50, self.sharePoint.y, [self calculateStringLength:content], 50);
}
break;
case 3://自定义场景
{
helpButton.frame = CGRectMake(self.photoPoint.x+50, self.photoPoint.y, [self calculateStringLength:content], 50);
}
break;
case 4://全屏
{
helpButton.frame = CGRectMake(self.fullScreenPoint.x+50, self.fullScreenPoint.y, [self calculateStringLength:content], 50);
}
break;
case 5://帮助
{
helpButton.frame = CGRectMake(self.helpPoint.x+50, self.helpPoint.y, [self calculateStringLength:content], 50);
}
break;
case 6://选择场景
{
helpButton.frame = CGRectMake(self.scenePoint.x+40, self.scenePoint.y-20, [self calculateStringLength:content], 50);
}
break;
case 7://选择产品
{
UIImage *helpImage = [TCImage(@"righttool") resizableImageWithCapInsets:UIEdgeInsetsMake(30, 30, 30, 30) resizingMode:UIImageResizingModeStretch];
[helpButton setBackgroundImage:helpImage forState:UIControlStateNormal];
helpButton.frame = CGRectMake(self.productPoint.x-[self calculateStringLength:content]-40, self.productPoint.y-20, [self calculateStringLength:content], 50);
}
break;
default:
break;
}
}
}
#pragma mark -计算字符串长度
- (CGFloat)calculateStringLength:(NSString *)string
{
CGSize s = [string boundingRectWithSize:CGSizeMake(999999, 50) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:15]} context:nil].size;
return s.width+100;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
...@@ -134,10 +134,15 @@ ...@@ -134,10 +134,15 @@
/** /**
* 服务器地址 * 服务器开发地址
*/ */
#define ServerAddress @"http://dg-dev.opple.com/opple-web/app" #define ServerAddress @"http://dg-dev.opple.com/opple-web/app"
/**
* 服务器测试地址
*/
//#define ServerAddress @"http://139.196.195.30:8090/opple-web/app"
/** /**
* 搜索框输入通知 * 搜索框输入通知
......
...@@ -48,6 +48,11 @@ ...@@ -48,6 +48,11 @@
*/ */
@property (weak, nonatomic) IBOutlet UITableView *screeningTableView; @property (weak, nonatomic) IBOutlet UITableView *screeningTableView;
/**
* 文本
*/
@property (weak, nonatomic) IBOutlet UILabel *titleLabe;
/** /**
* 风格 * 风格
...@@ -112,4 +117,9 @@ ...@@ -112,4 +117,9 @@
*/ */
@property (nonatomic,assign) id<AddImagesDelegate> delegate; @property (nonatomic,assign) id<AddImagesDelegate> delegate;
/**
* dismiss回传
*/
@property (nonatomic,copy) void(^dismissBlock)();
@end @end
...@@ -536,6 +536,7 @@ ...@@ -536,6 +536,7 @@
newModel.pictures = model.pictures; newModel.pictures = model.pictures;
newModel.barcode = model.barcode; newModel.barcode = model.barcode;
newModel.isSelectedState = NO; newModel.isSelectedState = NO;
newModel.goodsNumber = 1;
[weakSelf.productDatasArray addObject:newModel]; [weakSelf.productDatasArray addObject:newModel];
} }
for (TOGoodsEntityModel *model in SHARED_APPDELEGATE.productArray) { for (TOGoodsEntityModel *model in SHARED_APPDELEGATE.productArray) {
...@@ -1012,6 +1013,9 @@ ...@@ -1012,6 +1013,9 @@
#pragma mark -销毁 #pragma mark -销毁
- (void)ReturnButtonClickAction - (void)ReturnButtonClickAction
{ {
if (self.dismissBlock) {
self.dismissBlock();
}
[self dismissViewControllerAnimated:YES completion:nil]; [self dismissViewControllerAnimated:YES completion:nil];
} }
......
...@@ -57,4 +57,5 @@ ...@@ -57,4 +57,5 @@
*/ */
@property (nonatomic,assign) id<SharePicturedelegate> delegate; @property (nonatomic,assign) id<SharePicturedelegate> delegate;
@end @end
...@@ -29,8 +29,7 @@ ...@@ -29,8 +29,7 @@
[self dismissViewControllerAnimated:YES completion:nil]; [self dismissViewControllerAnimated:YES completion:nil];
NSData *imageData = UIImageJPEGRepresentation(self.shareImage, 0.5); NSData *imageData = UIImageJPEGRepresentation(self.shareImage, 0.5);
// 0b44439e5504e371015504f73d4f0025,0b44439e5504e371015504feae270028 NSDictionary *parameterDict = [NSDictionary dictionaryWithObjectsAndKeys:[self.goodsIds substringToIndex:self.goodsIds.length-2],@"goodsIds",@"",@"title",@"",@"remark",nil];
NSDictionary *parameterDict = [NSDictionary dictionaryWithObjectsAndKeys:self.goodsIds,@"goodsIds",@"",@"title",@"",@"remark",nil];
//上传图片 //上传图片
[[NetworkRequestClassManager Manager] UploadImageWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/system/shareGoods"] WithRequestType:0 WithImageDatas:imageData WithParameter:parameterDict WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] UploadImageWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/system/shareGoods"] WithRequestType:0 WithImageDatas:imageData WithParameter:parameterDict WithReturnValueBlock:^(id returnValue) {
......
//
// ShoppingBagTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 16/6/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ShoppingBagTableViewCell : UITableViewCell
@end
//
// ShoppingBagTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 16/6/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "ShoppingBagTableViewCell.h"
@implementation ShoppingBagTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// ShoppingBagViewController.h
// Lighting
//
// Created by 曹云霄 on 16/6/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface ShoppingBagViewController : BaseViewController
/**
* 购物袋tableView
*/
@property (weak, nonatomic) IBOutlet UITableView *shoppingBagTableView;
/**
* 合计金额
*/
@property (weak, nonatomic) IBOutlet UILabel *totalPriceLabe;
/**
* 确认添加
*/
@property (weak, nonatomic) IBOutlet UIButton *sureButton;
/**
* 购物袋背景
*/
@property (weak, nonatomic) IBOutlet UIView *shoppingBagBackView;
/**
* 数据源
*/
@property (nonatomic,strong) NSMutableArray *datasArray;
/**
* 全选
*/
@property (weak, nonatomic) IBOutlet UIButton *totalSelectedButton;
/**
* 删除
*/
@property (weak, nonatomic) IBOutlet UIButton *delectedButton;
/**
* dismiss回传
*/
@property (nonatomic,copy) void(^dismissBlock)();
@end
This diff is collapsed.
...@@ -17,4 +17,9 @@ ...@@ -17,4 +17,9 @@
*/ */
@property (nonatomic,assign) BOOL isSelectedState; @property (nonatomic,assign) BOOL isSelectedState;
/**
* 商品个数
*/
@property (nonatomic,assign) int goodsNumber;
@end @end
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