// // ShoppingView.m // Lighting // // Created by mac on 16/5/23. // Copyright © 2016年 上海勾芒科技有限公司. All rights reserved. // #import "ShoppingView.h" @interface ShoppingView () { NSMutableArray * textArray; } @end @implementation ShoppingView - (void)viewDidLoad { [super viewDidLoad]; [self initdata]; [self initView]; // Do any additional setup after loading the view. } -(void)initdata { self.isAllSelected=NO; self.nameDataArray=[[NSMutableArray alloc]initWithObjects:@"图片",@"产品信息",@"吊牌价",@"数量", nil]; self.productModelArray=[[NSMutableArray alloc]init]; self.AddArray=[[NSMutableArray alloc]init]; textArray=[[NSMutableArray alloc]initWithObjects:@"1",@"1",@"1",@"1",@"1", nil]; self.selectTagArray=[[NSMutableArray alloc]init]; } -(void)initView { self.subView=[[UIView alloc]initWithFrame:CGRectMake(100, 50, ScreenWidth-250, ScreenHeight-200)]; self.subView.backgroundColor=[UIColor whiteColor]; [self.view addSubview:self.subView]; //点击手势 UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(DismissScreenView:)]; tap.delegate = self; tap.cancelsTouchesInView = NO; [[UIApplication sharedApplication].keyWindow addGestureRecognizer:tap]; [self initSubViews]; } -(void)initSubViews { self.headerView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, self.subView.frame.size.width, 50)]; self.headerView.backgroundColor=RGB(225, 225, 225, 1); [self.subView addSubview:self.headerView]; UIButton *btn=[UIButton buttonWithType:UIButtonTypeCustom]; btn.frame=CGRectMake(20, 10, 30, 30); [btn setBackgroundImage:[UIImage imageNamed:@"addshopping"] forState:UIControlStateNormal]; [self.headerView addSubview:btn]; UILabel *lable=[[UILabel alloc]initWithFrame:CGRectMake(65, 10, 150, 30)]; lable.text=@"待添加至购物袋"; [self.headerView addSubview:lable]; self.toolView=[[UIView alloc]initWithFrame:CGRectMake(0,50, self.subView.frame.size.width, 50)]; self.toolView.backgroundColor=[UIColor grayColor]; [self.subView addSubview:self.toolView]; for (int i=0; i [obj2 integerValue]) { return (NSComparisonResult)NSOrderedAscending; } return (NSComparisonResult)NSOrderedSame; }; if ( productList.count>0) { productList=[NSMutableArray arrayWithArray:[productList sortedArrayUsingComparator:cmptr] ]; } return productList; } //加入购物车 -(void)addProducts:(UIButton *)sender { //加入购物车 //判断是否有当前客户 if (![Shoppersmanager manager].currentCustomer) { [self ErrorMBProgressView:@"必须设置当前客户"]; return; } SaveShoppingCartRequest *shopCar = [[SaveShoppingCartRequest alloc]init]; shopCar.consumerId = [Customermanager manager].model.fid; shopCar.goodsId =@""; shopCar.count = @""; for (int i=0; iScreenWidth-150||point.y<50||point.y>ScreenHeight-150) { if (self) { if ([self.delegate respondsToSelector:@selector(restShoppingBtnImage)]) { [self.delegate restShoppingBtnImage]; } [self.view removeFromSuperview]; } } } - (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