Commit fc73df70 authored by 曹云霄's avatar 曹云霄

增加体验中心切换多个灯的支持

parent e1af42d5
...@@ -109,7 +109,8 @@ ...@@ -109,7 +109,8 @@
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(KeyboadrDismiss) name:UIKeyboardWillHideNotification object:nil]; [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(KeyboadrDismiss) name:UIKeyboardWillHideNotification object:nil];
//设置当前客户通知 //设置当前客户通知
[[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];
//下拉刷新 //下拉刷新
MjRefreshHeaderCustom *headerRefresh = [MjRefreshHeaderCustom headerWithRefreshingBlock:^{ MjRefreshHeaderCustom *headerRefresh = [MjRefreshHeaderCustom headerWithRefreshingBlock:^{
...@@ -783,6 +784,13 @@ ...@@ -783,6 +784,13 @@
} }
} }
#pragma mark -清空当前客户的数据
- (void)ChangeCustomerName:(NSNotification *)not
{
[self.informationTableview.mj_header beginRefreshing];
[self ExitCurrentCustomer];
}
#pragma mark -友好界面 #pragma mark -友好界面
- (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView - (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView
...@@ -800,19 +808,6 @@ ...@@ -800,19 +808,6 @@
return YES; return YES;
} }
- (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 @end
...@@ -232,7 +232,7 @@ ...@@ -232,7 +232,7 @@
pop.permittedArrowDirections = UIPopoverArrowDirectionAny; pop.permittedArrowDirections = UIPopoverArrowDirectionAny;
pop.sourceView = changpassword.view; pop.sourceView = changpassword.view;
pop.barButtonItem = [[UIBarButtonItem alloc]initWithCustomView:_Newbutton]; pop.barButtonItem = [[UIBarButtonItem alloc]initWithCustomView:_Newbutton];
[self presentViewController:changpassword animated:NO completion:nil]; [self presentViewController:changpassword animated:YES completion:nil];
}]; }];
} }
......
...@@ -199,7 +199,7 @@ ...@@ -199,7 +199,7 @@
#pragma mark -修改密码 #pragma mark -修改密码
- (IBAction)ChangPasswordButtonClick:(UIButton *)sender { - (IBAction)ChangPasswordButtonClick:(UIButton *)sender {
if ([self.delegate respondsToSelector:@selector(changPasswordButtonClick)]) { if ([self.delegate respondsToSelector:@selector(changPasswordButtonClick)]) {
[self.delegate changPasswordButtonClick]; [self.delegate changPasswordButtonClick];
} }
...@@ -299,6 +299,7 @@ ...@@ -299,6 +299,7 @@
[Shoppersmanager manager].Shoppers = result; [Shoppersmanager manager].Shoppers = result;
[[NSNotificationCenter defaultCenter] postNotificationName:@"CHANGESHOPPERSNAME" object:result.employee.realName]; [[NSNotificationCenter defaultCenter] postNotificationName:@"CHANGESHOPPERSNAME" object:result.employee.realName];
[[NSNotificationCenter defaultCenter] postNotificationName:@"CHANGECUSTOMERNAME" object:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:@"CHANGECUSTOMERNAME" object:nil];
[[NSNotificationCenter defaultCenter] postNotificationName:@"EMPTYCUSTOMERNAME" object:nil];//情况当前客户数据
//保存用户名密码 //保存用户名密码
[[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];
......
...@@ -1717,8 +1717,8 @@ ...@@ -1717,8 +1717,8 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "Brand Assets"; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "Brand Assets";
CLANG_ENABLE_OBJC_WEAK = YES; CLANG_ENABLE_OBJC_WEAK = YES;
CODE_SIGN_IDENTITY = "iPhone Distribution: Shanghai Gomore Information Technology Co.,Ltd"; CODE_SIGN_IDENTITY = "iPhone Developer: 云霄 曹 (WM8ZU7YY98)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Shanghai Gomore Information Technology Co.,Ltd"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: 云霄 曹 (WM8ZU7YY98)";
COMPRESS_PNG_FILES = NO; COMPRESS_PNG_FILES = NO;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = "$(inherited)"; FRAMEWORK_SEARCH_PATHS = "$(inherited)";
...@@ -1761,7 +1761,7 @@ ...@@ -1761,7 +1761,7 @@
); );
PRODUCT_BUNDLE_IDENTIFIER = com.gomore.opple; PRODUCT_BUNDLE_IDENTIFIER = com.gomore.opple;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "10361169-d429-4810-90f6-528335fe4062"; PROVISIONING_PROFILE = "e9bd3600-5e9c-4cd0-a0d5-b7d8b0882ca8";
STRIP_PNG_TEXT = NO; STRIP_PNG_TEXT = NO;
TARGETED_DEVICE_FAMILY = 2; TARGETED_DEVICE_FAMILY = 2;
USER_HEADER_SEARCH_PATHS = "$(PODS_ROOT)/**"; USER_HEADER_SEARCH_PATHS = "$(PODS_ROOT)/**";
...@@ -1775,8 +1775,8 @@ ...@@ -1775,8 +1775,8 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "Brand Assets"; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "Brand Assets";
CLANG_ENABLE_OBJC_WEAK = YES; CLANG_ENABLE_OBJC_WEAK = YES;
CODE_SIGN_IDENTITY = "iPhone Distribution: Shanghai Gomore Information Technology Co.,Ltd"; CODE_SIGN_IDENTITY = "iPhone Developer: 云霄 曹 (WM8ZU7YY98)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Shanghai Gomore Information Technology Co.,Ltd"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: 云霄 曹 (WM8ZU7YY98)";
COMPRESS_PNG_FILES = NO; COMPRESS_PNG_FILES = NO;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = "$(inherited)"; FRAMEWORK_SEARCH_PATHS = "$(inherited)";
...@@ -1819,7 +1819,7 @@ ...@@ -1819,7 +1819,7 @@
); );
PRODUCT_BUNDLE_IDENTIFIER = com.gomore.opple; PRODUCT_BUNDLE_IDENTIFIER = com.gomore.opple;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "10361169-d429-4810-90f6-528335fe4062"; PROVISIONING_PROFILE = "e9bd3600-5e9c-4cd0-a0d5-b7d8b0882ca8";
STRIP_PNG_TEXT = NO; STRIP_PNG_TEXT = NO;
TARGETED_DEVICE_FAMILY = 2; TARGETED_DEVICE_FAMILY = 2;
USER_HEADER_SEARCH_PATHS = "$(PODS_ROOT)/**"; USER_HEADER_SEARCH_PATHS = "$(PODS_ROOT)/**";
......
...@@ -3041,6 +3041,18 @@ ...@@ -3041,6 +3041,18 @@
<action selector="HelpButtonClickAction:" destination="Gqn-uq-cA1" eventType="touchUpInside" id="vNb-YQ-vFg"/> <action selector="HelpButtonClickAction:" destination="Gqn-uq-cA1" eventType="touchUpInside" id="vNb-YQ-vFg"/>
</connections> </connections>
</button> </button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="zpl-1T-9tQ">
<rect key="frame" x="40" y="777" width="45" height="45"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="20"/>
<state key="normal" title="切换">
<color key="titleColor" red="0.34901960780000002" green="0.67450980390000004" blue="0.86274509799999999" alpha="1" colorSpace="calibratedRGB"/>
</state>
<state key="selected" backgroundImage="selectHelp"/>
<connections>
<action selector="changeLampImageClickAction:" destination="Gqn-uq-cA1" eventType="touchUpInside" id="aQh-gn-8yy"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="DZ8-8m-TAP"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="DZ8-8m-TAP">
<rect key="frame" x="32" y="921" width="60" height="60"/> <rect key="frame" x="32" y="921" width="60" height="60"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
......
...@@ -113,6 +113,11 @@ ...@@ -113,6 +113,11 @@
*/ */
@property (nonatomic,strong) NSMutableArray *productTempArray; @property (nonatomic,strong) NSMutableArray *productTempArray;
/**
* 保存创建的灯对象
*/
@property (nonatomic,strong) NSMutableArray *lampArray;
......
...@@ -73,6 +73,13 @@ ...@@ -73,6 +73,13 @@
return _productTempArray; return _productTempArray;
} }
- (NSMutableArray *)lampArray
{
if (!_lampArray) {
_lampArray = [NSMutableArray array];
}
return _lampArray;
}
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
...@@ -173,18 +180,19 @@ ...@@ -173,18 +180,19 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{ {
__weak typeof(self) weakSelf = self;
ProductScreeningTableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; ProductScreeningTableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
TOGoodsEntityModel *model = [self.productDatasArray objectAtIndex_opple:indexPath.row]; TOGoodsEntityModel *model = [self.productDatasArray objectAtIndex_opple:indexPath.row];
CGRect cellRect = [cell convertRect:cell.bounds toView:self.view]; CGRect cellRect = [cell convertRect:cell.bounds toView:self.view];
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,GoodsImageView *deleteImageView) {
//删除先判断数量 //删除先判断数量
for (TOGoodsEntityModel *newModel in self.shareGoodsArray) { for (TOGoodsEntityModel *newModel in weakSelf.shareGoodsArray) {
if ([newModel.fid isEqualToString:delectedModel.fid]) { if ([newModel.fid isEqualToString:delectedModel.fid]) {
if (newModel.goodsNumber <= 1) { if (newModel.goodsNumber <= 1) {
[self.shareGoodsArray removeObject:delectedModel]; [weakSelf.shareGoodsArray removeObject:delectedModel];
[weakSelf.lampArray removeObject:deleteImageView];
}else }else
{ {
newModel.goodsNumber --; newModel.goodsNumber --;
...@@ -198,7 +206,7 @@ ...@@ -198,7 +206,7 @@
imageView.frame = CGRectMake((ScreenWidth-266)/2, (ScreenHeight-200)/2, 266, 200); imageView.frame = CGRectMake((ScreenWidth-266)/2, (ScreenHeight-200)/2, 266, 200);
}]; }];
for (TOGoodsEntityModel *model in self.productDatasArray) { for (TOGoodsEntityModel *model in weakSelf.productDatasArray) {
model.isSelectedState = NO; model.isSelectedState = NO;
} }
model.isSelectedState = YES; model.isSelectedState = YES;
...@@ -214,9 +222,11 @@ ...@@ -214,9 +222,11 @@
}else }else
{ {
[self.shareGoodsArray addObject:model]; [self.shareGoodsArray addObject:model];
[self.lampArray addObject:imageView];
} }
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];
imageView.showImageViewAddress = [imags firstObject];
[self.sceneBackView addSubview:imageView]; [self.sceneBackView addSubview:imageView];
[self.productScrollview reloadData]; [self.productScrollview reloadData];
} }
...@@ -589,20 +599,25 @@ ...@@ -589,20 +599,25 @@
[self ErrorMBProgressView:message]; [self ErrorMBProgressView:message];
} }
#pragma mark -切换灯图片
- (void)didReceiveMemoryWarning { - (IBAction)changeLampImageClickAction:(UIButton *)sender {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated. //满足多组灯同时切换
for (GoodsImageView *imageView in self.lampArray) {
for (TOGoodsEntityModel *model in self.shareGoodsArray) {
NSArray *images = [model.pictures componentsSeparatedByString:@","];
if (![images containsObject:imageView.showImageViewAddress])continue;
NSInteger index = [images indexOfObject:imageView.showImageViewAddress];
if (index < images.count-1) {
[imageView sd_setImageWithURL:[NSURL URLWithString:[images objectAtIndex:index+=1]]];
imageView.showImageViewAddress = [images objectAtIndex:index];
} else {
[imageView sd_setImageWithURL:[NSURL URLWithString:[images firstObject]]];
imageView.showImageViewAddress = [images firstObject];
}
}
}
} }
/*
#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 @end
...@@ -21,6 +21,11 @@ ...@@ -21,6 +21,11 @@
/** /**
* 长按删除 * 长按删除
*/ */
@property (nonatomic,copy) void(^delectedBlock)(TOGoodsEntityModel *model); @property (nonatomic,copy) void(^delectedBlock)(TOGoodsEntityModel *model,GoodsImageView *imageView);
/**
* 显示图片地址
*/
@property (nonatomic,copy) NSString *showImageViewAddress;
@end @end
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
{ {
if (longPress.state == UIGestureRecognizerStateBegan) { if (longPress.state == UIGestureRecognizerStateBegan) {
if (self.delectedBlock) { if (self.delectedBlock) {
self.delectedBlock(self.model); self.delectedBlock(self.model,self);
} }
[self removeFromSuperview]; [self removeFromSuperview];
} }
......
...@@ -112,15 +112,15 @@ ...@@ -112,15 +112,15 @@
*/ */
//#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://139.196.195.30:8090/opple-web/app%@",URL] //#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://139.196.195.30:8090/opple-web/app%@",URL]
///**
// * 服务器测试地址
// */
//#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg-dev.opple.com/opple-web/app%@",URL]
//
/** /**
* 服务器正式地址 * 服务器测试地址
*/ */
#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg.opple.com/opple-web/app%@",URL] #define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg-dev.opple.com/opple-web/app%@",URL]
///**
// * 服务器正式地址
// */
//#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg.opple.com/opple-web/app%@",URL]
/** /**
* 搜索框输入通知 * 搜索框输入通知
......
...@@ -1025,14 +1025,5 @@ ...@@ -1025,14 +1025,5 @@
// Dispose of any resources that can be recreated. // 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 @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