Commit a4d5bbb3 authored by 勾芒's avatar 勾芒

caoyunxiao

parent ff5c95b0
...@@ -10,4 +10,37 @@ ...@@ -10,4 +10,37 @@
@interface AdditionalTableViewCell : UITableViewCell @interface AdditionalTableViewCell : UITableViewCell
/**
* 订单数据
*/
@property (nonatomic,strong) TOOrderEntity *model;
/**
* 是否开票
*/
@property (weak, nonatomic) IBOutlet UILabel *isInvoiceLabe;
/**
* 发票抬头
*/
@property (weak, nonatomic) IBOutlet UILabel *invoiceHeader;
/**
* 发票类型
*/
@property (weak, nonatomic) IBOutlet UILabel *invoiceType;
/**
* 支付方式
*/
@property (weak, nonatomic) IBOutlet UILabel *payType;
@end @end
...@@ -15,6 +15,24 @@ ...@@ -15,6 +15,24 @@
// Initialization code // Initialization code
} }
#pragma mark -赋值
- (void)setModel:(TOOrderEntity *)model
{
_model = model;
self.isInvoiceLabe.text = _model.isBill;
self.invoiceHeader.text = _model.billTitle;
self.invoiceType.text = _model.billType;
self.invoiceType.text = _model.payType;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated]; [super setSelected:selected animated:animated];
......
...@@ -75,6 +75,12 @@ ...@@ -75,6 +75,12 @@
</label> </label>
</subviews> </subviews>
</tableViewCellContentView> </tableViewCellContentView>
<connections>
<outlet property="invoiceHeader" destination="IhE-VI-oy0" id="7ib-gX-pBV"/>
<outlet property="invoiceType" destination="7ty-c7-Sgn" id="6gZ-Bc-NQq"/>
<outlet property="isInvoiceLabe" destination="Gdg-fx-ziI" id="F68-nq-sEW"/>
<outlet property="payType" destination="MPi-P0-LEg" id="zCn-bM-5y9"/>
</connections>
<point key="canvasLocation" x="420" y="242.5"/> <point key="canvasLocation" x="420" y="242.5"/>
</tableViewCell> </tableViewCell>
</objects> </objects>
......
...@@ -18,6 +18,11 @@ ...@@ -18,6 +18,11 @@
*/ */
@property (nonatomic,strong) NSMutableArray *CustomerresultArray; @property (nonatomic,strong) NSMutableArray *CustomerresultArray;
/**
* 当前页数
*/
@property (nonatomic,assign) int indexPage;
@end @end
@implementation ClientViewController @implementation ClientViewController
...@@ -41,7 +46,7 @@ ...@@ -41,7 +46,7 @@
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
[self uiConfigAction]; [self uiConfigAction];
[self getShoppersAssociatedCustomer];
} }
...@@ -82,7 +87,7 @@ ...@@ -82,7 +87,7 @@
self.addpersonInformationButton.layer.cornerRadius = kCornerRadius; self.addpersonInformationButton.layer.cornerRadius = kCornerRadius;
self.changePersonInformationButton.layer.masksToBounds = YES; self.changePersonInformationButton.layer.masksToBounds = YES;
self.changePersonInformationButton.layer.cornerRadius = kCornerRadius; self.changePersonInformationButton.layer.cornerRadius = kCornerRadius;
self.indexPage = 0;
//隐藏更改客户按钮 //隐藏更改客户按钮
self.changePersonInformationButton.hidden = YES; self.changePersonInformationButton.hidden = YES;
...@@ -94,24 +99,48 @@ ...@@ -94,24 +99,48 @@
//监听键盘落下的通知 //监听键盘落下的通知
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(KeyboadrDismiss) name:UIKeyboardWillHideNotification object:nil]; [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(KeyboadrDismiss) name:UIKeyboardWillHideNotification object:nil];
//下拉刷新
self.informationTableview.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
ConsumerQueryCondition *condition = [[ConsumerQueryCondition alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = 0;
condition.page = page;
page.rows = 10;
[self getShoppersAssociatedCustomer:condition isRemoveArray:YES];
}];
[self.informationTableview.mj_header beginRefreshing];
//上拉加载
self.informationTableview.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
ConsumerQueryCondition *condition = [[ConsumerQueryCondition alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = self.indexPage ++;
page.rows = 10;
condition.page = page;
[self getShoppersAssociatedCustomer:condition isRemoveArray:NO];
}];
} }
#pragma mark -获取导购关联客户 #pragma mark -获取导购关联客户
- (void)getShoppersAssociatedCustomer - (void)getShoppersAssociatedCustomer:(ConsumerQueryCondition *)condition isRemoveArray:(BOOL)remove
{ {
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
ConsumerQueryCondition *condition = [[ConsumerQueryCondition alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = 0;
condition.page = page;
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/consumer/query"] WithRequestType:0 WithParameter:condition WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/consumer/query"] WithRequestType:0 WithParameter:condition WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
[self endRefreshingForTableView:self.informationTableview];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
if (remove) {
[self.CustomerresultArray removeAllObjects];
}
ConsumerPageResult *Customerresult = [[ConsumerPageResult alloc]initWithDictionary:returnValue[@"data"] error:nil]; ConsumerPageResult *Customerresult = [[ConsumerPageResult alloc]initWithDictionary:returnValue[@"data"] error:nil];
for (TOConsumerEntity *objc in Customerresult.results) { for (TOConsumerEntity *objc in Customerresult.results) {
...@@ -132,7 +161,15 @@ ...@@ -132,7 +161,15 @@
[self.CustomerresultArray addObject:myclientModel]; [self.CustomerresultArray addObject:myclientModel];
} }
//刷新后添加选中状态
for (int i=0; i<self.CustomerresultArray.count; i++) {
MyclientEntityModel *myclientModel = [self.CustomerresultArray objectAtIndex_opple:i];
if ([[Customermanager manager].customerID isEqualToString:myclientModel.fid]) {
InformationTableViewCell *cell = [self.informationTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:i inSection:0]];
myclientModel.selectedState = YES;
cell.setCurrentCustomer.selected = YES;
}
}
[self.informationTableview reloadData]; [self.informationTableview reloadData];
} }
else else
...@@ -146,6 +183,7 @@ ...@@ -146,6 +183,7 @@
} WithFailureBlock:^(id error) { } WithFailureBlock:^(id error) {
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
[self endRefreshingForTableView:self.informationTableview];
}]; }];
} }
...@@ -158,7 +196,6 @@ ...@@ -158,7 +196,6 @@
cell.model = [self.CustomerresultArray objectAtIndex_opple:indexPath.row]; cell.model = [self.CustomerresultArray objectAtIndex_opple:indexPath.row];
//清空其他选中状态 //清空其他选中状态
[cell setBlockSeletced:^(NSInteger index) { [cell setBlockSeletced:^(NSInteger index) {
[self SetCustomerButtonClick:index]; [self SetCustomerButtonClick:index];
}]; }];
return cell; return cell;
...@@ -180,13 +217,17 @@ ...@@ -180,13 +217,17 @@
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"StoryboardwithCYX" bundle:nil]; UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"StoryboardwithCYX" bundle:nil];
ClientdetailsViewController *clientdetails = [storyboard instantiateViewControllerWithIdentifier:@"clientdetails"]; ClientdetailsViewController *clientdetails = [storyboard instantiateViewControllerWithIdentifier:@"clientdetails"];
clientdetails.model = [self.CustomerresultArray objectAtIndex_opple:indexPath.row]; clientdetails.model = [self.CustomerresultArray objectAtIndex_opple:indexPath.row];
clientdetails.cellindex = indexPath.row;
//设置当前客户
[clientdetails setCurrentUserBlock:^(NSInteger index) {
InformationTableViewCell *cell = [self.informationTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0]];
cell.setCurrentCustomer.selected = YES;
[self SetCustomerButtonClick:index];
}];
[self.navigationController pushViewController:clientdetails animated:YES]; [self.navigationController pushViewController:clientdetails animated:YES];
} }
#pragma mark -设置为当前客户回调 #pragma mark -设置为当前客户回调
- (void)SetCustomerButtonClick:(NSInteger)index; - (void)SetCustomerButtonClick:(NSInteger)index;
{ {
...@@ -214,10 +255,30 @@ ...@@ -214,10 +255,30 @@
[Customermanager manager].cutomerAddress = model.address; [Customermanager manager].cutomerAddress = model.address;
[self.addpersonInformationButton setTitle:@"退出当前客户" forState:UIControlStateNormal]; [self.addpersonInformationButton setTitle:@"退出当前客户" forState:UIControlStateNormal];
self.changePersonInformationButton.hidden = NO; self.changePersonInformationButton.hidden = NO;
[self SetupUserRequest];
} }
#pragma mark -设置为当前用户请求、写入访问时间
- (void)SetupUserRequest
{
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@%@",ServerAddress,@"/consumer/saveLastVisitedTime?consumerId=",[Customermanager manager].customerID] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) {
NSLog(@"写入客户访问时间成功");
}
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) {
NSLog(@"写入客户访问时间失败");
}];
}
#pragma mark -添加客户信息、或者退出当前客户 #pragma mark -添加客户信息、或者退出当前客户
- (IBAction)addCustomerInformationORExit:(UIButton *)sender { - (IBAction)addCustomerInformationORExit:(UIButton *)sender {
...@@ -387,7 +448,11 @@ ...@@ -387,7 +448,11 @@
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
ConsumerPageResult *result = [[ConsumerPageResult alloc]initWithDictionary:returnValue error:nil]; ConsumerPageResult *result = [[ConsumerPageResult alloc]initWithDictionary:returnValue error:nil];
NSLog(@"%@",result); [self.CustomerresultArray removeAllObjects];
for (TOConsumerEntity *model in result.results) {
[self.CustomerresultArray addObject:model];
}
[self.informationTableview reloadData];
} }
else else
{ {
......
...@@ -65,9 +65,16 @@ ...@@ -65,9 +65,16 @@
/**
* 设置当前客户
*/
@property (nonatomic,copy)void(^CurrentUserBlock)(NSInteger cellindex);
/**
* 传入当前cell下标
*/
@property (nonatomic,assign) NSInteger cellindex;
......
...@@ -166,6 +166,8 @@ ...@@ -166,6 +166,8 @@
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"StoryboardwithCYX" bundle:nil]; UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"StoryboardwithCYX" bundle:nil];
OrderdetailsViewController *orderdetails = [storyboard instantiateViewControllerWithIdentifier:@"orderdetails"]; OrderdetailsViewController *orderdetails = [storyboard instantiateViewControllerWithIdentifier:@"orderdetails"];
orderdetails.orderCode = [[[self.orderRecordArray objectAtIndex_opple:indexPath.row] order] orderNumber]; orderdetails.orderCode = [[[self.orderRecordArray objectAtIndex_opple:indexPath.row] order] orderNumber];
orderdetails.sectionTitle = @[@"订单信息",@"客户信息",@"收货信息",@"商品信息",@"附件信息"];
orderdetails.isShowattachment = YES;
[self.navigationController pushViewController:orderdetails animated:YES]; [self.navigationController pushViewController:orderdetails animated:YES];
} }
} }
...@@ -183,10 +185,12 @@ ...@@ -183,10 +185,12 @@
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/shopcart/query"] WithRequestType:0 WithParameter:shopcarNumber WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/shopcart/query"] WithRequestType:0 WithParameter:shopcarNumber WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding]; // [self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
ShopCartResponse *shopcar = [[ShopCartResponse alloc]initWithDictionary:returnValue[@"data"] error:nil]; ShopCartResponse *shopcar = [[ShopCartResponse alloc]initWithDictionary:returnValue[@"data"] error:nil];
if (shopcar.shopcart.count == 0) {
[self PromptinformationViewWithimage:TCImage(@"ablum-副本") withTitle:@"暂无购物袋信息~" withFrame:CGRectMake(200,200 , 250, 170)];
}
//自定义属性 //自定义属性
for (TOShopcartEntity *objc in shopcar.shopcart) { for (TOShopcartEntity *objc in shopcar.shopcart) {
...@@ -216,7 +220,7 @@ ...@@ -216,7 +220,7 @@
} WithFailureBlock:^(id error) { } WithFailureBlock:^(id error) {
[self RemoveMBProgressHUDLoding]; // [self RemoveMBProgressHUDLoding];
}]; }];
} }
...@@ -236,7 +240,6 @@ ...@@ -236,7 +240,6 @@
Neworder.guideId = [Shoppersmanager manager].Shoppers.employee.fid; Neworder.guideId = [Shoppersmanager manager].Shoppers.employee.fid;
allOrder.datapage = page; allOrder.datapage = page;
allOrder.order = Neworder; allOrder.order = Neworder;
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/order/query"] WithRequestType:0 WithParameter:allOrder WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/order/query"] WithRequestType:0 WithParameter:allOrder WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
...@@ -272,7 +275,9 @@ ...@@ -272,7 +275,9 @@
#pragma mark -设为当前的客户 #pragma mark -设为当前的客户
- (IBAction)SetupcurrentUserButtonClick:(UIButton *)sender { - (IBAction)SetupcurrentUserButtonClick:(UIButton *)sender {
if (self.CurrentUserBlock) {
self.CurrentUserBlock(_cellindex);
}
} }
......
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
OrderBill *allOrder = [[OrderBill alloc]init]; OrderBill *allOrder = [[OrderBill alloc]init];
//分页 //分页
DataPage *page = [[DataPage alloc]init]; DataPage *page = [[DataPage alloc]init];
page.page = self.indexPage; page.page = 0;
page.rows = 10; page.rows = 10;
//订单 //订单
TOOrderEntity *Neworder = [[TOOrderEntity alloc]init]; TOOrderEntity *Neworder = [[TOOrderEntity alloc]init];
......
...@@ -87,7 +87,6 @@ ...@@ -87,7 +87,6 @@
// [self SetTheRootViewController]; // [self SetTheRootViewController];
// return; // return;
if (self.userName.text.length == 0) { if (self.userName.text.length == 0) {
[self ErrorMBProgressView:@"用户名不能为空"]; [self ErrorMBProgressView:@"用户名不能为空"];
...@@ -98,22 +97,22 @@ ...@@ -98,22 +97,22 @@
[self ErrorMBProgressView:@"密码不能为空"]; [self ErrorMBProgressView:@"密码不能为空"];
return; return;
} }
[self judgeUserNameAndPassword]; [self judgeUserNameAndPassword];
} }
#pragma mark -设置根视图控制器 #pragma mark -设置根视图控制器
- (void)SetTheRootViewController - (void)SetTheRootViewController
{ {
RightViewController *rightVC = [[RightViewController alloc]init]; RightViewController *rightVC = [[RightViewController alloc]init];
rightVC.delegate = self; rightVC.delegate = self;
self.drawerController = [[MMDrawerController alloc]initWithCenterViewController:self.customtabbar rightDrawerViewController:rightVC]; UINavigationController *rightNav = [[UINavigationController alloc]initWithRootViewController:rightVC];
[self.drawerController setMaximumRightDrawerWidth:RightWidth]; self.drawerController = [[MMDrawerController alloc]initWithCenterViewController:self.customtabbar rightDrawerViewController:rightNav];
[self.drawerController setOpenDrawerGestureModeMask:MMOpenDrawerGestureModeAll]; [self.drawerController setMaximumRightDrawerWidth:RightWidth];
[self.drawerController setCloseDrawerGestureModeMask:MMCloseDrawerGestureModeAll]; [self.drawerController setOpenDrawerGestureModeMask:MMOpenDrawerGestureModeAll];
SHARED_APPDELEGATE.mmdrawer = self.drawerController; [self.drawerController setCloseDrawerGestureModeMask:MMCloseDrawerGestureModeAll];
SHARED_APPDELEGATE.window.rootViewController = self.drawerController; SHARED_APPDELEGATE.mmdrawer = self.drawerController;
SHARED_APPDELEGATE.Mytabbar = self.customtabbar; SHARED_APPDELEGATE.window.rootViewController = self.drawerController;
SHARED_APPDELEGATE.Mytabbar = self.customtabbar;
} }
...@@ -163,7 +162,6 @@ ...@@ -163,7 +162,6 @@
NSInteger selectedIndex; NSInteger selectedIndex;
if ([Name isEqualToString:@"体验中心"]) { if ([Name isEqualToString:@"体验中心"]) {
[SHARED_APPDELEGATE.window.rootViewController.view addSubview:self.followHeartView.view]; [SHARED_APPDELEGATE.window.rootViewController.view addSubview:self.followHeartView.view];
// selectedIndex = 6;
}else if ([Name isEqualToString:@"场景库"]) }else if ([Name isEqualToString:@"场景库"])
{ {
......
...@@ -208,6 +208,7 @@ ...@@ -208,6 +208,7 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"%ld",indexPath.section);
switch (indexPath.section) { switch (indexPath.section) {
case 0://订单信息 case 0://订单信息
{ {
...@@ -254,6 +255,7 @@ ...@@ -254,6 +255,7 @@
if (_isShowattachment) { if (_isShowattachment) {
AdditionalTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"fifthcell" forIndexPath:indexPath]; AdditionalTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"fifthcell" forIndexPath:indexPath];
cell.model = self.orderDetails.order;
return cell; return cell;
} }
} }
......
...@@ -32,4 +32,14 @@ ...@@ -32,4 +32,14 @@
@property (weak, nonatomic) IBOutlet UIButton *addShoppingbags; @property (weak, nonatomic) IBOutlet UIButton *addShoppingbags;
/**
* 点击加入购物车回调 ,返回当前按钮的CGPoint、及当前下标
*/
@property (nonatomic,copy) void(^ReturnCellCgpoint)(CGPoint point,NSInteger cellindex);
/**
* 传入cell下标
*/
@property (nonatomic,assign) NSInteger cellindex;
@end @end
...@@ -10,4 +10,26 @@ ...@@ -10,4 +10,26 @@
@implementation ProductCollectionViewCell @implementation ProductCollectionViewCell
/**
* 加入购物车点击
*/
- (IBAction)AddShoppingcarButtonClick:(UIButton *)sender {
CGPoint carButtonCenter = sender.center;
//把button在cell坐标转化为在tableView上的坐标
CGPoint point = [self convertPoint:carButtonCenter toView:self.superview.window];
//回调
if (_ReturnCellCgpoint)
{
_ReturnCellCgpoint(point,_cellindex);
}
}
@end @end
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
self.productDetilsTableview.tableHeaderView = self.headerView; self.productDetilsTableview.tableHeaderView = self.headerView;
//添加至购物车 //添加至购物车
[self.headerView.addGoodsShoppingbagsButton addTarget:self action:@selector(addGoodsShoppingbags) forControlEvents:UIControlEventTouchUpInside]; [self.headerView.addGoodsShoppingbagsButton addTarget:self action:@selector(addGoodsShoppingbags:) forControlEvents:UIControlEventTouchUpInside];
} }
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
return; return;
} }
goodsNumber --; goodsNumber --;
self.headerView.goodsNumber.text = [NSString stringWithFormat:@"%d",goodsNumber]; self.headerView.goodsNumber.text = [NSString stringWithFormat:@"%ld",(long)goodsNumber];
} }
break; break;
...@@ -172,7 +172,7 @@ ...@@ -172,7 +172,7 @@
return; return;
} }
goodsNumber ++; goodsNumber ++;
self.headerView.goodsNumber.text = [NSString stringWithFormat:@"%d",goodsNumber]; self.headerView.goodsNumber.text = [NSString stringWithFormat:@"%ld",(long)goodsNumber];
} }
break; break;
...@@ -201,7 +201,7 @@ ...@@ -201,7 +201,7 @@
if ([inputString integerValue] > [self.entity.number integerValue]) { if ([inputString integerValue] > [self.entity.number integerValue]) {
[self ErrorMBProgressView:@"超过库存数量"]; [self ErrorMBProgressView:@"超过库存数量"];
textField.text = [NSString stringWithFormat:@"%d",[self.entity.number integerValue]]; textField.text = [NSString stringWithFormat:@"%ld",(long)[self.entity.number integerValue]];
return; return;
} }
} }
...@@ -227,8 +227,60 @@ ...@@ -227,8 +227,60 @@
//@synthesize goodsTotalPrice; //@synthesize goodsTotalPrice;
//@synthesize consumerId; //@synthesize consumerId;
#pragma mark -开发加入购物车动画
- (void)StartAddShoppingCarAnimationWithimage:(UIImage *)image withStartpoint:(CGPoint)point
{
//起点
CGPoint startPoint = point;
//终点
CGPoint endPoint = SHARED_APPDELEGATE.shoppingCarPoint;
//控点
CGPoint controlPoint = CGPointMake(endPoint.x, startPoint.x);
UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 40, 40)];
imageView.layer.position = point;
imageView.tag = 100;
imageView.image = image;
[self.view.layer addSublayer:imageView.layer];
//创建关键帧
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
animation.delegate = self;
//动画时间
animation.duration = 1;
//当动画完成,停留到结束位置
animation.removedOnCompletion = NO;
animation.fillMode = kCAFillModeForwards;
//当方法名字遇到create,new,copy,retain,都需要管理内存
CGMutablePathRef path = CGPathCreateMutable();
//设置起点
CGPathMoveToPoint(path, NULL, startPoint.x, startPoint.y);
CGPathAddQuadCurveToPoint(path, NULL, controlPoint.x, controlPoint.y, endPoint.x,endPoint.y);
//设置动画路径
animation.path = path;
//执行动画
[imageView.layer addAnimation:animation forKey:nil];
//释放路径
CGPathRelease(path);
}
#pragma mark -完成加入购物车动画完成后回调
- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag
{
NSLog(@"动画完成了");
[[NSNotificationCenter defaultCenter]postNotificationName:REFRESHSHOPPINGCAR object:@([self.headerView.goodsNumber.text intValue])];
}
#pragma mark -添加至购物车 #pragma mark -添加至购物车
- (void)addGoodsShoppingbags - (void)addGoodsShoppingbags:(UIButton *)button
{ {
//判断是否有当前客户 //判断是否有当前客户
if (![Shoppersmanager manager].currentCustomer) { if (![Shoppersmanager manager].currentCustomer) {
...@@ -236,19 +288,18 @@ ...@@ -236,19 +288,18 @@
[self ErrorMBProgressView:@"必须设置当前客户"]; [self ErrorMBProgressView:@"必须设置当前客户"];
return; return;
} }
[self CreateMBProgressHUDLoding]; [self StartAddShoppingCarAnimationWithimage:TCImage(@"欧") withStartpoint:[self.view convertPoint:[button center] toView:self.view.window]];
SaveShoppingCartRequest *shopCar = [[SaveShoppingCartRequest alloc]init]; SaveShoppingCartRequest *shopCar = [[SaveShoppingCartRequest alloc]init];
shopCar.consumerId = [[Customermanager manager] customerID]; shopCar.consumerId = [[Customermanager manager] customerID];
shopCar.goodsId = _goodsID; shopCar.goodsId = _goodsID;
shopCar.count = [self.headerView.goodsNumber.text intValue]; shopCar.count = [self.headerView.goodsNumber.text intValue];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/shopcart/save"] WithRequestType:0 WithParameter:shopCar WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/shopcart/save"] WithRequestType:0 WithParameter:shopCar WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
[self SuccessMBProgressView:@"加入购物车成功"]; [self SuccessMBProgressView:@"加入购物车成功"];
//刷新购物车 //刷新购物车
[[NSNotificationCenter defaultCenter]postNotificationName:@"GOODSNUMBER" object:returnValue[@"data"]]; [[NSNotificationCenter defaultCenter]postNotificationName:REFRESHSHOPPINGCAR object:returnValue[@"data"]];
}else }else
{ {
...@@ -260,7 +311,8 @@ ...@@ -260,7 +311,8 @@
} WithFailureBlock:^(id error) { } WithFailureBlock:^(id error) {
[self RemoveMBProgressHUDLoding]; [self ErrorMBProgressView:@"添加购物车失败"];
}]; }];
} }
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
#pragma mark -布局 #pragma mark -布局
- (void)uiConfigAction - (void)uiConfigAction
{ {
self.rightTableview = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, RightWidth, ScreenHeight) style:UITableViewStylePlain]; self.rightTableview = [[UITableView alloc]initWithFrame:CGRectMake(0, 100, RightWidth, ScreenHeight-100) style:UITableViewStylePlain];
self.rightTableview.delegate = self; self.rightTableview.delegate = self;
self.rightTableview.dataSource = self; self.rightTableview.dataSource = self;
[self.view addSubview:self.rightTableview]; [self.view addSubview:self.rightTableview];
...@@ -80,19 +80,22 @@ ...@@ -80,19 +80,22 @@
- (void)createHeaderview - (void)createHeaderview
{ {
UIView *headerView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, RightWidth, NavigationHeight)]; UIView *headerView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, RightWidth, NavigationHeight)];
//UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 13, 115, 35)]; //阴影
//imageView.center = CGPointMake(RightWidth/2, 100); headerView.layer.shadowColor = [UIColor blackColor].CGColor;
//imageView.image = TCImage(@"欧"); headerView.layer.shadowRadius = 4;
//[headerView addSubview:imageView]; headerView.layer.shadowOpacity = 0.5;
headerView.backgroundColor = [UIColor colorWithRed:61.0f/255.0f green:171.0f/255.0f blue:225.0f/255.0f alpha:1]; headerView.layer.shadowOffset = CGSizeMake(0,0);
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(RightWidth/4, 13, 115, 35)]; headerView.backgroundColor = kMainBlueColor;
UILabel *label = [[UILabel alloc] initWithFrame:headerView.frame];
label.text = @"功能菜单"; label.text = @"功能菜单";
label.font = [UIFont fontWithName:@"Helvetica" size:20.0]; label.font = [UIFont boldSystemFontOfSize:20];
[label setTextColor:[UIColor whiteColor]]; [label setTextColor:[UIColor whiteColor]];
[headerView addSubview:label]; [headerView addSubview:label];
self.rightTableview.tableHeaderView = headerView; label.textAlignment = NSTextAlignmentCenter;
[self.navigationController.navigationBar addSubview:headerView];
} }
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{ {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"rightcell" forIndexPath:indexPath]; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"rightcell" forIndexPath:indexPath];
...@@ -105,8 +108,6 @@ ...@@ -105,8 +108,6 @@
{ {
cell.imageView.image = [UIImage imageNamed:[self.imageArray objectAtIndex_opple:indexPath.row]]; cell.imageView.image = [UIImage imageNamed:[self.imageArray objectAtIndex_opple:indexPath.row]];
} }
return cell; return cell;
} }
...@@ -140,7 +141,6 @@ ...@@ -140,7 +141,6 @@
[self recoveryCell]; [self recoveryCell];
}]; }];
} }
if ([self.delegate respondsToSelector:@selector(SelectedControllerWithIndex:)]) { if ([self.delegate respondsToSelector:@selector(SelectedControllerWithIndex:)]) {
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/** /**
* 列表数据 * 列表数据
*/ */
@property (nonatomic,strong) SceneResponse *response; @property (nonatomic,strong) NSMutableArray *responseArray;
/** /**
...@@ -29,6 +29,10 @@ ...@@ -29,6 +29,10 @@
*/ */
@property (nonatomic,strong) NSArray *imageArray; @property (nonatomic,strong) NSArray *imageArray;
/**
* 当前页数
*/
@property (nonatomic,assign) int indexPage;
@end @end
...@@ -44,8 +48,20 @@ ...@@ -44,8 +48,20 @@
_imageArray = [NSArray arrayWithObjects:@"视角1",@"视角",@"视角3", nil]; _imageArray = [NSArray arrayWithObjects:@"视角1",@"视角",@"视角3", nil];
} }
return _imageArray; return _imageArray;
} }
/**
* 初始化数据源
*/
- (NSMutableArray *)responseArray
{
if (_responseArray == nil) {
_responseArray = [NSMutableArray array];
}
return _responseArray;
}
- (void)viewDidLoad { - (void)viewDidLoad {
...@@ -86,13 +102,34 @@ ...@@ -86,13 +102,34 @@
self.SpaceButton.layer.cornerRadius = 10; self.SpaceButton.layer.cornerRadius = 10;
[self.backView addSubview:self.StyleButton]; [self.backView addSubview:self.StyleButton];
[self.backView addSubview:self.SpaceButton]; [self.backView addSubview:self.SpaceButton];
self.indexPage = 0;
//下拉刷新
self.seceneLibararyCollectionView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
//默认数据
SceneCondition *condition = [[SceneCondition alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = self.indexPage;
page.rows = 10;
condition.page = page;
[self getSceneLibrarydatas:condition isRemove:YES];
}];
[self.seceneLibararyCollectionView.mj_header beginRefreshing];
//上拉加载
self.seceneLibararyCollectionView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
//默认数据
SceneCondition *condition = [[SceneCondition alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = self.indexPage ++;
page.rows = 10;
condition.page = page;
[self getSceneLibrarydatas:condition isRemove:NO];
}];
//默认数据
SceneCondition *condition = [[SceneCondition alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = 0;
condition.page = page;
[self getSceneLibrarydatas:condition];
} }
#pragma mark -获取场景筛选数据 #pragma mark -获取场景筛选数据
- (void)getdatasAction - (void)getdatasAction
...@@ -102,7 +139,6 @@ ...@@ -102,7 +139,6 @@
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
self.filter = [[SceneFilter alloc]initWithDictionary:returnValue[@"data"] error:nil]; self.filter = [[SceneFilter alloc]initWithDictionary:returnValue[@"data"] error:nil];
} }
else else
{ {
...@@ -118,16 +154,23 @@ ...@@ -118,16 +154,23 @@
#pragma mark -获取场景列表数据 #pragma mark -获取场景列表数据
- (void)getSceneLibrarydatas:(SceneCondition *)condition - (void)getSceneLibrarydatas:(SceneCondition *)condition isRemove:(BOOL)remove
{ {
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/scene/query"] WithRequestType:0 WithParameter:condition WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/scene/query"] WithRequestType:0 WithParameter:condition WithReturnValueBlock:^(id returnValue) {
[self endRefreshingForTableView:self.seceneLibararyCollectionView];
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
self.response = [[SceneResponse alloc]initWithDictionary:returnValue[@"data"] error:nil]; if (remove) {
[self.responseArray removeAllObjects];
}
SceneResponse *response = [[SceneResponse alloc]initWithDictionary:returnValue[@"data"] error:nil];
for (TOSceneEntity *model in response.list) {
[self.responseArray addObject:model];
}
[self.seceneLibararyCollectionView reloadData]; [self.seceneLibararyCollectionView reloadData];
} }
else else
...@@ -140,6 +183,7 @@ ...@@ -140,6 +183,7 @@
} WithFailureBlock:^(id error) { } WithFailureBlock:^(id error) {
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
[self endRefreshingForTableView:self.seceneLibararyCollectionView];
}]; }];
} }
...@@ -148,13 +192,13 @@ ...@@ -148,13 +192,13 @@
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{ {
SeceneLibraryCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"secenelibrary" forIndexPath:indexPath]; SeceneLibraryCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"secenelibrary" forIndexPath:indexPath];
cell.model = [self.response.list objectAtIndex_opple:indexPath.item]; cell.model = [self.responseArray objectAtIndex_opple:indexPath.item];
return cell; return cell;
} }
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{ {
return self.response.list.count; return self.responseArray.count;
} }
...@@ -168,7 +212,6 @@ ...@@ -168,7 +212,6 @@
#pragma mark -筛选风格 #pragma mark -筛选风格
- (void)screeningStyleButtonClick:(UIButton *)sender { - (void)screeningStyleButtonClick:(UIButton *)sender {
[self ShowPopoverViewController:CGSizeMake(200, 300) Withdatas:self.filter.styles ShowButton:sender SelectedIndex:0]; [self ShowPopoverViewController:CGSizeMake(200, 300) Withdatas:self.filter.styles ShowButton:sender SelectedIndex:0];
} }
...@@ -184,13 +227,11 @@ ...@@ -184,13 +227,11 @@
#pragma mark -弹出popover视图控制器 #pragma mark -弹出popover视图控制器
- (void)ShowPopoverViewController:(CGSize)size Withdatas:(NSArray *)datasArray ShowButton:(UIButton *)button SelectedIndex:(NSInteger)index - (void)ShowPopoverViewController:(CGSize)size Withdatas:(NSArray *)datasArray ShowButton:(UIButton *)button SelectedIndex:(NSInteger)index
{ {
PopoverViewController *popover = [[PopoverViewController alloc]init]; PopoverViewController *popover = [[PopoverViewController alloc]init];
popover.datasArray = datasArray; popover.datasArray = datasArray;
popover.delegate = self; popover.delegate = self;
popover.Selectedindex = index; popover.Selectedindex = index;
if (size.width == 55) { if (size.width == 55) {
popover.isPictures = YES; popover.isPictures = YES;
} }
popover.contentSize = size; popover.contentSize = size;
...@@ -223,8 +264,7 @@ ...@@ -223,8 +264,7 @@
condition.styleEquals = Type; condition.styleEquals = Type;
[self.StyleButton setTitle:title forState:UIControlStateNormal]; [self.StyleButton setTitle:title forState:UIControlStateNormal];
} }
[self getSceneLibrarydatas:condition isRemove:YES];
[self getSceneLibrarydatas:condition];
} }
...@@ -253,7 +293,6 @@ ...@@ -253,7 +293,6 @@
default: default:
break; break;
} }
[self.accordingStyle setBackgroundImage:TCImage([self.imageArray objectAtIndex_opple:selectedIndex]) forState:UIControlStateNormal]; [self.accordingStyle setBackgroundImage:TCImage([self.imageArray objectAtIndex_opple:selectedIndex]) forState:UIControlStateNormal];
[self dismissViewControllerAnimated:YES completion:nil]; [self dismissViewControllerAnimated:YES completion:nil];
self.seceneLibraryCollectionLayout.itemSize = CGSizeMake((ScreenWidth-showcellNumber*2)/showcellNumber, (ScreenWidth-showcellNumber*2)/showcellNumber-50); self.seceneLibraryCollectionLayout.itemSize = CGSizeMake((ScreenWidth-showcellNumber*2)/showcellNumber, (ScreenWidth-showcellNumber*2)/showcellNumber-50);
......
...@@ -83,6 +83,7 @@ ...@@ -83,6 +83,7 @@
[self.localSearchArray addObject:not.object]; [self.localSearchArray addObject:not.object];
//调用商品控制器 //调用商品控制器
ProductLibraryViewController *productVC = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"productlibrary"]; ProductLibraryViewController *productVC = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"productlibrary"];
productVC.selectedCode = not.object;
[self.navigationController pushViewController:productVC animated:YES]; [self.navigationController pushViewController:productVC animated:YES];
} }
...@@ -113,6 +114,7 @@ ...@@ -113,6 +114,7 @@
#pragma mark -将要加载前获取本地搜索历史 #pragma mark -将要加载前获取本地搜索历史
- (void)viewWillAppear:(BOOL)animated - (void)viewWillAppear:(BOOL)animated
{ {
[super viewWillAppear:animated];
[self getlocalsaveDatas]; [self getlocalsaveDatas];
} }
...@@ -120,6 +122,7 @@ ...@@ -120,6 +122,7 @@
#pragma mark -视图消失后归档搜索历史 #pragma mark -视图消失后归档搜索历史
- (void)viewDidDisappear:(BOOL)animated - (void)viewDidDisappear:(BOOL)animated
{ {
[super viewDidDisappear:animated];
[self.view endEditing:YES]; [self.view endEditing:YES];
[self SaveSearchDatas]; [self SaveSearchDatas];
} }
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
{ {
_model = model; _model = model;
[self.scenarioImageView sd_setImageWithURL:[NSURL URLWithString:_model.pricure] placeholderImage:ReplaceImage]; [self.scenarioImageView sd_setImageWithURL:[NSURL URLWithString:_model.pricure] placeholderImage:REPLACEIMAGE];
} }
......
...@@ -128,12 +128,11 @@ ...@@ -128,12 +128,11 @@
<subviews> <subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="5O3-uQ-Ccg"> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="5O3-uQ-Ccg">
<rect key="frame" x="10" y="0.0" width="190" height="30"/> <rect key="frame" x="10" y="0.0" width="190" height="30"/>
<color key="backgroundColor" red="0.93333333330000001" green="0.93333333330000001" blue="0.93333333330000001" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/> <fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/> <textInputTraits key="textInputTraits"/>
</textField> </textField>
</subviews> </subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" red="0.93333333333333335" green="0.93333333333333335" blue="0.93333333333333335" alpha="1" colorSpace="calibratedRGB"/>
</view> </view>
</subviews> </subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
......
...@@ -81,6 +81,10 @@ ...@@ -81,6 +81,10 @@
self.generateOrderTableview.dataSource = self; self.generateOrderTableview.dataSource = self;
self.generateOrderTableview.delegate = self; self.generateOrderTableview.delegate = self;
self.generateOrderTableview.tableFooterView = [UIView new]; self.generateOrderTableview.tableFooterView = [UIView new];
self.backShoppingbagsButton.layer.masksToBounds = YES;
self.backShoppingbagsButton.layer.cornerRadius = kCornerRadius;
self.createOrderButton.layer.masksToBounds = YES;
self.createOrderButton.layer.cornerRadius = kCornerRadius;
} }
...@@ -114,7 +118,15 @@ ...@@ -114,7 +118,15 @@
[[self.datasArray objectAtIndex_opple:1]insertObject:Newmodel atIndex:0]; [[self.datasArray objectAtIndex_opple:1]insertObject:Newmodel atIndex:0];
} }
[self.generateOrderTableview reloadData]; //地址数组
NSArray *addressArray = [self.datasArray objectAtIndex_opple:1];
//增加cell
NSMutableArray *addCellArray = [NSMutableArray array];
for (int i=0; i<addressArray.count-1; i++) {
NSIndexPath *indexpath = [NSIndexPath indexPathForRow:i inSection:1];
[addCellArray addObject:indexpath];
}
[self.generateOrderTableview insertRowsAtIndexPaths:addCellArray withRowAnimation:UITableViewRowAnimationLeft];
} }
else else
{ {
...@@ -188,30 +200,8 @@ ...@@ -188,30 +200,8 @@
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{ {
// return [[self.datasArray objectAtIndex_opple:section] count];
NSArray *arr = [self.datasArray objectAtIndex_opple:section]; NSArray *arr = [self.datasArray objectAtIndex_opple:section];
return arr.count; return arr.count;
// switch (section) {
// case 0:
// {
// return 1;
// }
// break;
// case 1:
// {
// return 2;
// }
// break;
// case 2:
// {
// return 2;
// }
// break;
//
// default:
// break;
// }
// return 0;
} }
...@@ -230,7 +220,8 @@ ...@@ -230,7 +220,8 @@
break; break;
case 2: case 2:
{ {
if (indexPath.row == 1) { NSArray *arr = [self.datasArray objectAtIndex_opple:indexPath.section];
if (indexPath.row == arr.count-1) {
return 50; return 50;
} }
...@@ -254,7 +245,7 @@ ...@@ -254,7 +245,7 @@
break; break;
case 1: case 1:
{ {
return 10; return 5;
} }
break; break;
case 2: case 2:
...@@ -274,7 +265,7 @@ ...@@ -274,7 +265,7 @@
switch (section) { switch (section) {
case 1: case 1:
{ {
UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 10)]; UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 5)];
imageView.image = TCImage(@"lineNew"); imageView.image = TCImage(@"lineNew");
UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 44)]; UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 44)];
[view addSubview:imageView]; [view addSubview:imageView];
......
...@@ -8,6 +8,23 @@ ...@@ -8,6 +8,23 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "ShopcarModel.h" #import "ShopcarModel.h"
@protocol ChangeGoodsNumberDelegate <NSObject>
/**
* 当前商品数量、成交价
*/
- (void)ChangeGoodsNumber:(int)goodsNumber WithcostPrice:(NSInteger)costprice Withcellindex:(NSInteger)cellindex;
@end
@interface ShoppingTableViewCell : UITableViewCell @interface ShoppingTableViewCell : UITableViewCell
/** /**
...@@ -68,10 +85,15 @@ ...@@ -68,10 +85,15 @@
/**
* 成交价背景View
*/
@property (weak, nonatomic) IBOutlet UIView *ClinchPriceBackView;
/**
* 商品数量
*/
@property (nonatomic,assign) id<ChangeGoodsNumberDelegate>delegate;
......
...@@ -13,9 +13,18 @@ ...@@ -13,9 +13,18 @@
- (void)awakeFromNib { - (void)awakeFromNib {
[super awakeFromNib]; [super awakeFromNib];
// Initialization code // Initialization code
[self uiConfigAction];
} }
#pragma mark -UI
- (void)uiConfigAction
{
self.ClinchPriceBackView.layer.masksToBounds = YES;
self.ClinchPriceBackView.layer.cornerRadius = kCornerRadius;
}
#pragma mark -赋值 #pragma mark -赋值
- (void)setModel:(ShopcarModel *)model - (void)setModel:(ShopcarModel *)model
{ {
...@@ -71,10 +80,12 @@ ...@@ -71,10 +80,12 @@
default: default:
break; break;
} }
//改变价格
self.productPriceLabe.text = [NSString stringWithFormat:@"¥%ld",[self.goodsNumbersLabe.text integerValue]*[_model.goods.costPrice integerValue]];
if ([self.delegate respondsToSelector:@selector(ChangeGoodsNumber:WithcostPrice:Withcellindex:)]) {
[self.delegate ChangeGoodsNumber:[self.goodsNumbersLabe.text intValue] WithcostPrice:[self.clinchTextfield.text integerValue]Withcellindex:_cellindex];
}
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#import "GenerateOrdersViewController.h" #import "GenerateOrdersViewController.h"
#import "ShopcarModel.h" #import "ShopcarModel.h"
@interface ShoppingViewController ()<UITableViewDelegate,UITableViewDataSource> @interface ShoppingViewController ()<UITableViewDelegate,UITableViewDataSource,ChangeGoodsNumberDelegate>
@property (weak, nonatomic) IBOutlet UITableView *shoppingTableview; @property (weak, nonatomic) IBOutlet UITableView *shoppingTableview;
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
* 购物车数据源 * 购物车数据源
*/ */
@property (nonatomic,strong) NSMutableArray *shopResponseArray; @property (nonatomic,strong) NSMutableArray *shopResponseArray;
@end @end
@implementation ShoppingViewController @implementation ShoppingViewController
...@@ -47,10 +50,9 @@ ...@@ -47,10 +50,9 @@
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
[self uiConfigAction]; [self uiConfigAction];
[self getShoppingCardata];
} }
#pragma mark -渲染完成
- (void)viewDidAppear:(BOOL)animated - (void)viewDidAppear:(BOOL)animated
{ {
[super viewDidAppear:animated]; [super viewDidAppear:animated];
...@@ -59,24 +61,35 @@ ...@@ -59,24 +61,35 @@
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = NO; self.navigationController.interactivePopGestureRecognizer.enabled = NO;
} }
[self.shopResponseArray removeAllObjects];
[self InitializeState];
[self getShoppingCardata];
} }
#pragma mark -视图即将消失
- (void)viewWillDisappear:(BOOL)animated - (void)viewWillDisappear:(BOOL)animated
{ {
[super viewWillDisappear:animated]; [super viewWillDisappear:animated];
[self.shopResponseArray removeAllObjects];
[self getShoppingCardata];
// 开启 // 开启
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = YES; self.navigationController.interactivePopGestureRecognizer.enabled = YES;
} }
} }
#pragma mark -初始化状态
- (void)InitializeState
{
[self.settlementButton setTitle:@"去结算(0)" forState:UIControlStateNormal];
self.allSelectedButton.selected = NO;
self.totalpriceLabe.text = nil;
}
#pragma mark - UI #pragma mark - UI
- (void)uiConfigAction - (void)uiConfigAction
{ {
self.settlementButton.layer.masksToBounds = YES;
self.settlementButton.layer.cornerRadius = kCornerRadius;
self.view.backgroundColor = kTCColor(238, 238, 238); self.view.backgroundColor = kTCColor(238, 238, 238);
self.shoppingTableview.dataSource = self; self.shoppingTableview.dataSource = self;
self.shoppingTableview.delegate = self; self.shoppingTableview.delegate = self;
...@@ -84,6 +97,8 @@ ...@@ -84,6 +97,8 @@
self.shoppingTableview.tableFooterView = [UIView new]; self.shoppingTableview.tableFooterView = [UIView new];
} }
#pragma mark -获取购物车商品 #pragma mark -获取购物车商品
- (void)getShoppingCardata - (void)getShoppingCardata
{ {
...@@ -100,9 +115,10 @@ ...@@ -100,9 +115,10 @@
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/shopcart/query"] WithRequestType:0 WithParameter:shopcarNumber WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/shopcart/query"] WithRequestType:0 WithParameter:shopcarNumber WithReturnValueBlock:^(id returnValue) {
[self endRefreshingForTableView:self.shoppingTableview];
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
ShopCartResponse *shopcar = [[ShopCartResponse alloc]initWithDictionary:returnValue[@"data"] error:nil]; ShopCartResponse *shopcar = [[ShopCartResponse alloc]initWithDictionary:returnValue[@"data"] error:nil];
//自定义属性 //自定义属性
for (TOShopcartEntity *objc in shopcar.shopcart) { for (TOShopcartEntity *objc in shopcar.shopcart) {
...@@ -131,6 +147,7 @@ ...@@ -131,6 +147,7 @@
} WithFailureBlock:^(id error) { } WithFailureBlock:^(id error) {
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
[self endRefreshingForTableView:self.shoppingTableview];
}]; }];
} }
...@@ -141,6 +158,7 @@ ...@@ -141,6 +158,7 @@
ShoppingTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Shopping" forIndexPath:indexPath]; ShoppingTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Shopping" forIndexPath:indexPath];
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.model = [self.shopResponseArray objectAtIndex_opple:indexPath.row]; cell.model = [self.shopResponseArray objectAtIndex_opple:indexPath.row];
cell.delegate = self;
cell.cellindex = indexPath.row; cell.cellindex = indexPath.row;
//cell选中回调 //cell选中回调
[cell setReturnCellblock:^(NSInteger index) { [cell setReturnCellblock:^(NSInteger index) {
...@@ -179,7 +197,14 @@ ...@@ -179,7 +197,14 @@
if (model.isSelected) { if (model.isSelected) {
goodsNumber ++; goodsNumber ++;
} }
if (goodsNumber == 0) {
self.allSelectedButton.selected = NO;
}
if (goodsNumber == self.shopResponseArray.count) {
self.allSelectedButton.selected = YES;
}
} }
[self CalculateSelectedGoodsAllprice];
[self.settlementButton setTitle:[NSString stringWithFormat:@"去结算(%ld)",goodsNumber] forState:UIControlStateNormal]; [self.settlementButton setTitle:[NSString stringWithFormat:@"去结算(%ld)",goodsNumber] forState:UIControlStateNormal];
} }
...@@ -209,7 +234,6 @@ ...@@ -209,7 +234,6 @@
#pragma mark -全选 #pragma mark -全选
- (IBAction)allSelectedButtonClick:(UIButton *)sender { - (IBAction)allSelectedButtonClick:(UIButton *)sender {
sender.selected = !sender.selected; sender.selected = !sender.selected;
if (sender.selected) { if (sender.selected) {
...@@ -222,6 +246,9 @@ ...@@ -222,6 +246,9 @@
model.isSelected = YES; model.isSelected = YES;
} }
[self.settlementButton setTitle:[NSString stringWithFormat:@"去结算(%ld)",self.shopResponseArray.count] forState:UIControlStateNormal];
//计算总金额
[self CalculateSelectedGoodsAllprice];
}else }else
{ {
//取消全部选中 //取消全部选中
...@@ -233,9 +260,22 @@ ...@@ -233,9 +260,22 @@
model.isSelected = NO; model.isSelected = NO;
} }
[self.settlementButton setTitle:@"去结算(0)" forState:UIControlStateNormal];
} }
} }
#pragma mark -计算选中后的商品总金额
- (void)CalculateSelectedGoodsAllprice
{
NSInteger allPrice = 0;
for (ShopcarModel *model in self.shopResponseArray) {
if (model.isSelected) {
allPrice += [model.goods.costPrice integerValue] * model.goodsNum;
}
}
self.totalpriceLabe.text = [NSString stringWithFormat:@"¥%ld",allPrice];
}
#pragma mark -删除选中商品 #pragma mark -删除选中商品
- (IBAction)delecteSelectedGoods:(UIButton *)sender { - (IBAction)delecteSelectedGoods:(UIButton *)sender {
...@@ -277,7 +317,9 @@ ...@@ -277,7 +317,9 @@
} }
[self.shoppingTableview deleteRowsAtIndexPaths:delecteArray withRowAnimation:UITableViewRowAnimationLeft]; [self.shoppingTableview deleteRowsAtIndexPaths:delecteArray withRowAnimation:UITableViewRowAnimationLeft];
[self SuccessMBProgressView:@"删除成功"]; [self SuccessMBProgressView:@"删除成功"];
[self CalculateSelectedGoodsAllprice];
self.allSelectedButton.selected = NO;
[self.settlementButton setTitle:@"去结算(0)" forState:UIControlStateNormal];
}else }else
{ {
[self ErrorMBProgressView:returnValue[@"message"]]; [self ErrorMBProgressView:returnValue[@"message"]];
...@@ -289,14 +331,25 @@ ...@@ -289,14 +331,25 @@
} WithFailureBlock:^(id error) { } WithFailureBlock:^(id error) {
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
}]; }];
} }
#pragma mark -改变商品数量
- (void)ChangeGoodsNumber:(int)goodsNumber WithcostPrice:(NSInteger)costprice Withcellindex:(NSInteger)cellindex
{
//保存商品数量
ShopcarModel *model = [self.shopResponseArray objectAtIndex_opple:cellindex];
model.goodsNum = goodsNumber;
// [self.shopResponseArray replaceObjectAtIndex:cellindex withObject:model];
//保存成交价格
ShopcarModel *Newmodel = [self.shopResponseArray objectAtIndex_opple:cellindex];
Newmodel.goods.costPrice = [NSNumber numberWithInteger:costprice];
// [self.shopResponseArray replaceObjectAtIndex:cellindex withObject:Newmodel];
[self CalculateSelectedGoodsAllprice];
}
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
......
...@@ -53,6 +53,30 @@ ...@@ -53,6 +53,30 @@
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self.selectedViewController beginAppearanceTransition: YES animated: animated];
}
-(void) viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[self.selectedViewController endAppearanceTransition];
}
-(void) viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
[self.selectedViewController beginAppearanceTransition: NO animated: animated];
}
-(void) viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
[self.selectedViewController endAppearanceTransition];
}
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
...@@ -71,7 +95,6 @@ ...@@ -71,7 +95,6 @@
toolview.delegate = self; toolview.delegate = self;
toolview.inputField.delegate = self; toolview.inputField.delegate = self;
[self.tabBar addSubview:toolview]; [self.tabBar addSubview:toolview];
// SHARED_APPDELEGATE.Mytabbar = self.tabBar;
} }
......
...@@ -81,9 +81,9 @@ ...@@ -81,9 +81,9 @@
[button addTarget:self action:@selector(QrCodeButtonClickAction) forControlEvents:UIControlEventTouchUpInside]; [button addTarget:self action:@selector(QrCodeButtonClickAction) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:button]; [self addSubview:button];
//按钮 //按钮
NSArray *titleArray = [NSArray arrayWithObjects:@"功能菜单",@"某某用户",@"我的客户",@"购物车", nil]; NSString *userName = [Shoppersmanager manager].Shoppers.employee.userName?[Shoppersmanager manager].Shoppers.employee.userName:@"某某用户";
NSArray *titleArray = [NSArray arrayWithObjects:@"功能菜单",userName,@"我的客户",@"购物车", nil];
//图片 //图片
NSArray *imageArray = [NSArray arrayWithObjects:@"dial",@"Cog",@"data",@"ablum", nil]; NSArray *imageArray = [NSArray arrayWithObjects:@"dial",@"Cog",@"data",@"ablum", nil];
for (int i=1; i<5; i++) { for (int i=1; i<5; i++) {
...@@ -94,17 +94,20 @@ ...@@ -94,17 +94,20 @@
[button setTitle:[titleArray objectAtIndex_opple:i-1] forState:UIControlStateNormal]; [button setTitle:[titleArray objectAtIndex_opple:i-1] forState:UIControlStateNormal];
button.tag = 100+i-1; button.tag = 100+i-1;
[button addTarget:self action:@selector(ButtonClick:) forControlEvents:UIControlEventTouchUpInside]; [button addTarget:self action:@selector(ButtonClick:) forControlEvents:UIControlEventTouchUpInside];
[button setImage:TCImage([imageArray objectAtIndex_opple:i-1]) forState:UIControlStateNormal]; [button setImage:TCImage([imageArray objectAtIndex_opple:i-1]) forState:UIControlStateNormal];
[self addSubview:button]; [self addSubview:button];
if (i == 4) {
SHARED_APPDELEGATE.shoppingCarPoint = [self convertPoint:CGPointMake(button.center.x, button.center.y) toView:self.window];
}
} }
// //创建下划线 // //创建下划线
// CustomButton *button = (CustomButton *)[self viewWithTag:102]; // CustomButton *button = (CustomButton *)[self viewWithTag:102];
// self.underlineView = [[UIView alloc]initWithFrame:CGRectMake(button.frame.origin.x+(ButtonWIDTH-50)/2, ButtonRIGHT+9, 50, 1)]; // self.underlineView = [[UIView alloc]initWithFrame:CGRectMake(button.frame.origin.x+(ButtonWIDTH-50)/2, ButtonRIGHT+9, 50, 1)];
// _underlineView.backgroundColor = [UIColor redColor]; // _underlineView.backgroundColor = [UIColor redColor];
// [self addSubview:self.underlineView]; // [self addSubview:self.underlineView];
//刷新购物车数量
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshGoodsNumber:) name:@"GOODSNUMBER" object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshGoodsNumber:) name:REFRESHSHOPPINGCAR object:nil];
} }
...@@ -112,7 +115,7 @@ ...@@ -112,7 +115,7 @@
- (void)refreshGoodsNumber:(NSNotification *)objc - (void)refreshGoodsNumber:(NSNotification *)objc
{ {
CustomButton *button = (CustomButton *)[self viewWithTag:103]; CustomButton *button = (CustomButton *)[self viewWithTag:103];
button.instructionsNumber = [objc.object integerValue]; button.instructionsNumber += [objc.object integerValue];
} }
......
...@@ -38,7 +38,8 @@ ...@@ -38,7 +38,8 @@
2942F8A81CDD80CE005B377E /* authenticateView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2942F8A71CDD80CE005B377E /* authenticateView.xib */; }; 2942F8A81CDD80CE005B377E /* authenticateView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2942F8A71CDD80CE005B377E /* authenticateView.xib */; };
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 */; };
2949BAC41CD3086F0049385A /* weibo.png in Resources */ = {isa = PBXBuildFile; fileRef = 2949BAC31CD3086F0049385A /* weibo.png */; }; 294CF0EC1CEDCF480055F1D8 /* PromptinformationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 294CF0EB1CEDCF480055F1D8 /* PromptinformationView.m */; };
294CF0EE1CEDCF540055F1D8 /* PromptinformationView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 294CF0ED1CEDCF540055F1D8 /* PromptinformationView.xib */; };
2962D06D1CD1A43A0058829D /* ClientViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2962D06C1CD1A43A0058829D /* ClientViewController.m */; }; 2962D06D1CD1A43A0058829D /* ClientViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2962D06C1CD1A43A0058829D /* ClientViewController.m */; };
2962D0711CD1A58B0058829D /* RightViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2962D0701CD1A58B0058829D /* RightViewController.m */; }; 2962D0711CD1A58B0058829D /* RightViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2962D0701CD1A58B0058829D /* RightViewController.m */; };
2962D0791CD1CBC60058829D /* NetworkRequestClassManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 2962D0781CD1CBC60058829D /* NetworkRequestClassManager.m */; }; 2962D0791CD1CBC60058829D /* NetworkRequestClassManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 2962D0781CD1CBC60058829D /* NetworkRequestClassManager.m */; };
...@@ -182,7 +183,9 @@ ...@@ -182,7 +183,9 @@
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>"; };
2949BAC11CD3055A0049385A /* MMExampleDrawerVisualStateManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMExampleDrawerVisualStateManager.m; sourceTree = "<group>"; }; 2949BAC11CD3055A0049385A /* MMExampleDrawerVisualStateManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMExampleDrawerVisualStateManager.m; sourceTree = "<group>"; };
2949BAC31CD3086F0049385A /* weibo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = weibo.png; sourceTree = "<group>"; }; 294CF0EA1CEDCF480055F1D8 /* PromptinformationView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PromptinformationView.h; sourceTree = "<group>"; };
294CF0EB1CEDCF480055F1D8 /* PromptinformationView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PromptinformationView.m; sourceTree = "<group>"; };
294CF0ED1CEDCF540055F1D8 /* PromptinformationView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PromptinformationView.xib; sourceTree = "<group>"; };
2962D06B1CD1A43A0058829D /* ClientViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientViewController.h; sourceTree = "<group>"; }; 2962D06B1CD1A43A0058829D /* ClientViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientViewController.h; sourceTree = "<group>"; };
2962D06C1CD1A43A0058829D /* ClientViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ClientViewController.m; sourceTree = "<group>"; }; 2962D06C1CD1A43A0058829D /* ClientViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ClientViewController.m; sourceTree = "<group>"; };
2962D06F1CD1A58B0058829D /* RightViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RightViewController.h; sourceTree = "<group>"; }; 2962D06F1CD1A58B0058829D /* RightViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RightViewController.h; sourceTree = "<group>"; };
...@@ -497,6 +500,7 @@ ...@@ -497,6 +500,7 @@
2928F7DE1CD085430036D761 /* Tools */ = { 2928F7DE1CD085430036D761 /* Tools */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
294CF0E91CEDCF250055F1D8 /* PromptinformationView */,
29A9DCAA1CEB63BD00A7567A /* PreviewPDF */, 29A9DCAA1CEB63BD00A7567A /* PreviewPDF */,
2985AE9A1CE72F1500704C91 /* ZXPUnicode */, 2985AE9A1CE72F1500704C91 /* ZXPUnicode */,
29BFBD841CE4288A00C238FB /* Customercenter */, 29BFBD841CE4288A00C238FB /* Customercenter */,
...@@ -506,7 +510,6 @@ ...@@ -506,7 +510,6 @@
29EC331C1CE02ADC005F0C13 /* popoverController */, 29EC331C1CE02ADC005F0C13 /* popoverController */,
29EAAEAB1CDCA28300C4DBA2 /* city.json */, 29EAAEAB1CDCA28300C4DBA2 /* city.json */,
2949BABF1CD305340049385A /* MMDrawerManager */, 2949BABF1CD305340049385A /* MMDrawerManager */,
2949BAC31CD3086F0049385A /* weibo.png */,
2962D07E1CD1E5DD0058829D /* UIView+Frame */, 2962D07E1CD1E5DD0058829D /* UIView+Frame */,
2962D07A1CD1E3CC0058829D /* NSarray+category */, 2962D07A1CD1E3CC0058829D /* NSarray+category */,
2962D0761CD1CB860058829D /* NetworkRequest */, 2962D0761CD1CB860058829D /* NetworkRequest */,
...@@ -659,6 +662,16 @@ ...@@ -659,6 +662,16 @@
name = MMDrawerManager; name = MMDrawerManager;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
294CF0E91CEDCF250055F1D8 /* PromptinformationView */ = {
isa = PBXGroup;
children = (
294CF0EA1CEDCF480055F1D8 /* PromptinformationView.h */,
294CF0EB1CEDCF480055F1D8 /* PromptinformationView.m */,
294CF0ED1CEDCF540055F1D8 /* PromptinformationView.xib */,
);
name = PromptinformationView;
sourceTree = "<group>";
};
2962D06A1CD1A3FE0058829D /* MyClient */ = { 2962D06A1CD1A3FE0058829D /* MyClient */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -1241,9 +1254,9 @@ ...@@ -1241,9 +1254,9 @@
29807C621CD20C2A00F111B8 /* Images.xcassets in Resources */, 29807C621CD20C2A00F111B8 /* Images.xcassets in Resources */,
29834EB61CDF1EB6001A484F /* screeningSecondView.xib in Resources */, 29834EB61CDF1EB6001A484F /* screeningSecondView.xib in Resources */,
299249461CDB51C800786B1E /* ModifyShippingAddressView.xib in Resources */, 299249461CDB51C800786B1E /* ModifyShippingAddressView.xib in Resources */,
294CF0EE1CEDCF540055F1D8 /* PromptinformationView.xib in Resources */,
29834EBB1CDF1FBC001A484F /* screeningFirstView.xib in Resources */, 29834EBB1CDF1FBC001A484F /* screeningFirstView.xib in Resources */,
29EAAEAC1CDCA28300C4DBA2 /* city.json in Resources */, 29EAAEAC1CDCA28300C4DBA2 /* city.json in Resources */,
2949BAC41CD3086F0049385A /* weibo.png in Resources */,
29EAAE971CDC4B2900C4DBA2 /* The Swift Programming Language 中文版 - v1.2.pdf in Resources */, 29EAAE971CDC4B2900C4DBA2 /* The Swift Programming Language 中文版 - v1.2.pdf in Resources */,
2928F83D1CD0A9CD0036D761 /* qq.png in Resources */, 2928F83D1CD0A9CD0036D761 /* qq.png in Resources */,
29834EC61CDF76C1001A484F /* UserViewController.xib in Resources */, 29834EC61CDF76C1001A484F /* UserViewController.xib in Resources */,
...@@ -1346,6 +1359,7 @@ ...@@ -1346,6 +1359,7 @@
2942F8A61CDD80C2005B377E /* authenticateView.m in Sources */, 2942F8A61CDD80C2005B377E /* authenticateView.m in Sources */,
044CD6F11CEB81350004A715 /* ProductCollectionPictureCell.m in Sources */, 044CD6F11CEB81350004A715 /* ProductCollectionPictureCell.m in Sources */,
29BFBD8F1CE44BA900C238FB /* goodsDetailsSectionview.m in Sources */, 29BFBD8F1CE44BA900C238FB /* goodsDetailsSectionview.m in Sources */,
294CF0EC1CEDCF480055F1D8 /* PromptinformationView.m in Sources */,
290887131CE5DF16000B7097 /* ShopcarModel.m in Sources */, 290887131CE5DF16000B7097 /* ShopcarModel.m in Sources */,
29BB27681CD9D38E009A0813 /* AllpriceTableViewCell.m in Sources */, 29BB27681CD9D38E009A0813 /* AllpriceTableViewCell.m in Sources */,
29BB27771CD9DFBA009A0813 /* ProductLibraryViewController.m in Sources */, 29BB27771CD9DFBA009A0813 /* ProductLibraryViewController.m in Sources */,
......
...@@ -36,6 +36,13 @@ ...@@ -36,6 +36,13 @@
*/ */
@property (nonatomic,strong) UITabBarController *Mytabbar; @property (nonatomic,strong) UITabBarController *Mytabbar;
/**
* 保存购物车坐标
*/
@property (nonatomic,assign) CGPoint shoppingCarPoint;
- (void)saveContext; - (void)saveContext;
- (NSURL *)applicationDocumentsDirectory; - (NSURL *)applicationDocumentsDirectory;
......
...@@ -68,6 +68,9 @@ ...@@ -68,6 +68,9 @@
*/ */
- (void)callAirprintWithURL:(NSURL *)datasurl SuccessBlock:(void(^)())success ErrorBlock:(void(^)())failed; - (void)callAirprintWithURL:(NSURL *)datasurl SuccessBlock:(void(^)())success ErrorBlock:(void(^)())failed;
/**
* 提示图片、文本
*/
- (void)PromptinformationViewWithimage:(UIImage *)image withTitle:(NSString *)title withFrame:(CGRect)frame;
@end @end
...@@ -84,7 +84,8 @@ ...@@ -84,7 +84,8 @@
#pragma mark -移除MBProgressHUD等待视图 #pragma mark -移除MBProgressHUD等待视图
- (void)RemoveMBProgressHUDLoding; - (void)RemoveMBProgressHUDLoding;
{ {
[self.TCHud hide:YES afterDelay:1]; // [self.TCHud hide:YES afterDelay:1];
[self.TCHud hide:YES];
self.TCHud = nil; self.TCHud = nil;
} }
...@@ -239,8 +240,15 @@ ...@@ -239,8 +240,15 @@
} }
#pragma mark -提示文本,图片
- (void)PromptinformationViewWithimage:(UIImage *)image withTitle:(NSString *)title withFrame:(CGRect)frame
{
PromptinformationView *promptView = [[[NSBundle mainBundle] loadNibNamed:@"PromptinformationView" owner:self options:nil] firstObject];
promptView.tipsImage.image = image;
promptView.tipsTitle.text = title;
promptView.frame = frame;
[self.view addSubview:promptView];
}
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#import "UIImageView+WebCache.h" #import "UIImageView+WebCache.h"
#import "Customermanager.h" #import "Customermanager.h"
#import "AppDelegate.h" #import "AppDelegate.h"
#import "PromptinformationView.h"
// Include any system framework and library headers here that should be included in all compilation units. // Include any system framework and library headers here that should be included in all compilation units.
// You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
...@@ -164,7 +165,10 @@ ...@@ -164,7 +165,10 @@
#define REPLACEIMAGE [UIImage imageNamed:@"bg-img 副本"] #define REPLACEIMAGE [UIImage imageNamed:@"bg-img 副本"]
/**
* 刷新购物车通知
*/
#define REFRESHSHOPPINGCAR @"GOODSNUMBER"
......
//
// PromptinformationView.h
// Lighting
//
// Created by 曹云霄 on 16/5/19.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface PromptinformationView : UIView
/**
* 提示图片
*/
@property (weak, nonatomic) IBOutlet UIImageView *tipsImage;
/**
* 提示文本
*/
@property (weak, nonatomic) IBOutlet UILabel *tipsTitle;
@end
//
// PromptinformationView.m
// Lighting
//
// Created by 曹云霄 on 16/5/19.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "PromptinformationView.h"
@implementation PromptinformationView
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="PromptinformationView">
<rect key="frame" x="0.0" y="0.0" width="250" height="170"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ablum-副本" translatesAutoresizingMaskIntoConstraints="NO" id="qMb-Xb-WTj">
<rect key="frame" x="75" y="20" width="100" height="100"/>
<constraints>
<constraint firstAttribute="width" constant="100" id="EUY-t9-cPB"/>
<constraint firstAttribute="height" constant="100" id="HFH-CD-XOc"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="暂无购物车信息~" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LFz-XE-idb">
<rect key="frame" x="0.0" y="149" width="250" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="69o-Ap-cCk"/>
<constraint firstAttribute="width" constant="250" id="bcy-ai-4U1"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.8666666666666667" green="0.8666666666666667" blue="0.8666666666666667" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="qMb-Xb-WTj" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="20" id="4CO-0a-rAb"/>
<constraint firstAttribute="trailing" secondItem="LFz-XE-idb" secondAttribute="trailing" id="Ad4-Su-7RU"/>
<constraint firstAttribute="trailing" secondItem="qMb-Xb-WTj" secondAttribute="trailing" constant="75" id="Xcw-EJ-8KM"/>
<constraint firstItem="LFz-XE-idb" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="lP9-GB-8CF"/>
<constraint firstAttribute="bottom" secondItem="LFz-XE-idb" secondAttribute="bottom" id="rg3-BP-kwR"/>
<constraint firstItem="LFz-XE-idb" firstAttribute="top" secondItem="qMb-Xb-WTj" secondAttribute="bottom" constant="29" id="z9u-cY-Swt"/>
<constraint firstItem="qMb-Xb-WTj" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="75" id="znj-i0-nqz"/>
</constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="tipsImage" destination="qMb-Xb-WTj" id="jB2-L2-1Cu"/>
<outlet property="tipsTitle" destination="LFz-XE-idb" id="gmc-UM-BsN"/>
</connections>
<point key="canvasLocation" x="290" y="231"/>
</view>
</objects>
<resources>
<image name="ablum-副本" width="101" height="104"/>
</resources>
</document>
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