Commit 4650a3d1 authored by zhu's avatar zhu

购物车

parent 144b8687
......@@ -12,6 +12,7 @@
#import "FootSubView.h"
#import "SeceneLibraryView.h"
#import "ProductLibraryView.h"
#import "ShoppingView.h"
@protocol FollowHeartViewAddpicturedelegate <NSObject>
@required
......@@ -28,9 +29,11 @@
@property (nonatomic,strong) FootSubView *footSubView;
@property (nonatomic,strong) SeceneLibraryView *seceneLibraryView;
@property (nonatomic,strong) ProductLibraryView *productLibraryView;
@property (nonatomic,strong) ShoppingView *shoppingView;
@property (nonatomic,strong) UIImageView *backGroundImageView;
@property (nonatomic,strong) UIButton *zoomButton;
@property (nonatomic,strong) UIButton *temporaryBtn;
@property (nonatomic,strong) NSMutableArray *productModelArray;
......
......@@ -24,6 +24,7 @@
}
-(void)configSubView
{
self.productModelArray=[[NSMutableArray alloc]init];
self.backGroundImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"backView.png"]];
self.backGroundImageView.frame=CGRectMake(0, 0, ScreenWidth, ScreenHeight);
[self.view addSubview:self.backGroundImageView];
......@@ -51,7 +52,7 @@
break;
case 101: //购物车
{
[self addShoppingView];
}
break;
case 102: //分享
......@@ -98,11 +99,12 @@
self.backGroundImageView.image=image;
}
//产品附图回调
- (void)resetSubProductImage:(UIImage*)image
- (void)resetSubProductImage:(UIImage*)image productModel:(NSMutableArray *)productModel
{
ImageCropperView *cropper=[[ImageCropperView alloc]initWithFrame:CGRectMake(400, 300, 300, 300)];
cropper.layer.borderWidth = 1.0;
cropper.layer.borderColor = [UIColor blueColor].CGColor;
// cropper.layer.borderWidth = 1.0;
// cropper.layer.borderColor = [UIColor blueColor].CGColor;
cropper.image = image;
[self.view addSubview:cropper];
}
......@@ -112,9 +114,9 @@
[self.footSubView addFootSubViewImage:image];
}
//产品库选图回调
- (void)addProductImage:(UIImage *)image
- (void)addProductImage:(UIImage *)image productModel:(TOGoodsEntity *)productModel
{
[self.rightSubView addRightSubViewImage:image];
[self.rightSubView addRightSubViewImage:image productModel:productModel];
}
//全屏
-(void)setViewAnimations:(UIButton *)sender
......@@ -172,6 +174,16 @@
self.productLibraryView.delegate=self;
[self.view addSubview:self.productLibraryView.view];
}
//添加购物车
-(void)addShoppingView
{
self.shoppingView=[[ShoppingView alloc]init];
self.shoppingView.view.backgroundColor=[UIColor clearColor];
self.shoppingView.productModelArray=self.productModelArray;
// self.shoppingView.delegate=self;
[self.view addSubview:self.shoppingView.view];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
......
......@@ -11,20 +11,19 @@
@interface ProductCollectionPictureCell : UICollectionViewCell
@property (strong, nonatomic) UIImageView *productImageView;
/**
* 产品参数
*/
//产品参数
@property (strong, nonatomic) UILabel *productParameter;
/**
* 产品价格
*/
// 产品价格
@property (strong, nonatomic) UILabel *productPrice;
// 产品描述
@property (strong, nonatomic) UILabel *productDesce;
@property (strong, nonatomic) TOGoodsEntity *productModel;
/**
* 加入购物车
*/
@property (strong, nonatomic) UIButton *addShoppingbags;
@end
......@@ -12,9 +12,23 @@
-(id)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if (self) {
self.productImageView =[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
self.productImageView.image = [UIImage imageNamed:@"05产品库-详情_03"];
self.productImageView =[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, frame.size.width, 2*frame.size.height/3)];
[self addSubview:self.productImageView];
// 产品描述
self.productDesce=[[UILabel alloc]initWithFrame:CGRectMake(0,2*frame.size.height/3, frame.size.width, frame.size.height/6)];
self.productDesce.text=@"名称描述";
self.productDesce.textAlignment=NSTextAlignmentCenter;
[self addSubview: self.productDesce];
// 产品参数
self.productParameter=[[UILabel alloc]initWithFrame:CGRectMake(0, 2*frame.size.height/3+ frame.size.height/6, frame.size.width, frame.size.height/6)];
self.productParameter.textAlignment=NSTextAlignmentCenter;
[self addSubview: self.productParameter];
// 产品价格
self.productPrice=[[UILabel alloc]initWithFrame:CGRectMake(0, 2*frame.size.height/3+ 2*frame.size.height/6, frame.size.width, frame.size.height/6)];
self.productPrice.textAlignment=NSTextAlignmentCenter;
[self addSubview: self.productPrice];
self.productModel=[[TOGoodsEntity alloc]init];
}
return self;
}
......
......@@ -13,7 +13,7 @@
@required
//回调
- (void)addProductImage:(UIImage *)image;
- (void)addProductImage:(UIImage *)image productModel:(TOGoodsEntity*)productModel;
@end
......@@ -28,22 +28,22 @@ UICollectionViewDelegate,UICollectionViewDelegateFlowLayout>
@property (nonatomic,strong) UIButton *fengGeBtn;
@property (nonatomic,strong) UIButton *leiXingBtn;
@property (nonatomic,strong) NSMutableArray *nameData;
@property (nonatomic,strong) NSArray *arrayData;
@property (nonatomic,strong) NSMutableArray *arrayData;
@property (nonatomic,strong) NSMutableArray *array1;
@property (nonatomic,strong) NSMutableArray *array2;
@property (nonatomic,strong) NSMutableArray *array3;
@property (nonatomic,strong) UICollectionView *collectionView;
/**
* 筛选数据源
*/
//筛选数据源
@property (nonatomic,strong) NSMutableArray *screeningDatas;
@property (nonatomic,strong) GoodsFilter *goodsFilter;
/**
* 商品数据源对象
*/
//商品数据源对象
@property (nonatomic,strong) NSMutableArray *datasArray;
/**
* 商品iD
*/
//商品iD
@property (nonatomic,copy) NSString *goodsID;
//当前页数
@property (nonatomic,assign) int indexPage;
// 搜索code
@property (nonatomic,copy) NSString *selectedCode;
@end
This diff is collapsed.
......@@ -12,12 +12,13 @@
//回调
- (void)buttonClick:(NSInteger)btnTag withButton:(UIButton *)button;
- (void)resetSubProductImage:(UIImage*)image;
- (void)resetSubProductImage:(UIImage*)image productModel:(NSMutableArray *)productModel;
@end
@interface RightSubView : UIView
@property (nonatomic,assign) id<RightViewBtnClickdelegate> delegate;
@property (nonatomic,strong)NSMutableArray *dataArray;
@property (nonatomic,strong)NSMutableArray *productModelArray;
@property (nonatomic,strong)UIScrollView *scrollView;
-(void)addRightSubViewImage:(UIImage*)image;
-(void)addRightSubViewImage:(UIImage*)image productModel:(TOGoodsEntity *)productModel;
@end
......@@ -23,6 +23,7 @@
NSString *imageName = [NSString stringWithFormat:@"05产品库-详情_03" ];
UIImage *image= [UIImage imageNamed:imageName];
self.dataArray=[[NSMutableArray alloc]initWithObjects:image,image,image,nil];
self.productModelArray=[[NSMutableArray alloc]init];
// 待接收
}
......@@ -67,9 +68,9 @@
-(void)clicked:(UIButton*)sender
{
NSLog(@"%d",(sender.tag));
if ([self.delegate respondsToSelector:@selector(resetSubProductImage:)]) {
if ([self.delegate respondsToSelector:@selector(resetSubProductImage:productModel:)]) {
[self.delegate resetSubProductImage:sender.imageView.image];
[self.delegate resetSubProductImage:sender.imageView.image productModel:self.productModelArray];
}
// resetSuperBackGroundImage
......@@ -100,8 +101,9 @@
}
}
-(void)addRightSubViewImage:(UIImage*)image
-(void)addRightSubViewImage:(UIImage*)image productModel:(TOGoodsEntity *)productModel
{
[self.productModelArray addObject:productModel];
[self.dataArray addObject:image];
[self showProductPicture];
......
......@@ -28,7 +28,7 @@ UICollectionViewDelegate,UICollectionViewDelegateFlowLayout>
@property (nonatomic,strong) UIButton *kongJianBtn;
@property (nonatomic,strong) UIButton *fengGeBtn;
@property (nonatomic,strong) UIButton *leiXingBtn;
@property (nonatomic,strong) NSArray *arrayData;
@property (nonatomic,strong) NSMutableArray *arrayData;
@property (nonatomic,strong) NSMutableArray *array1;
@property (nonatomic,strong) NSMutableArray *array2;
@property (nonatomic,strong) NSMutableArray *array3;
......@@ -38,5 +38,8 @@ UICollectionViewDelegate,UICollectionViewDelegateFlowLayout>
@property (nonatomic,strong) NSArray *imageArray;//筛选cell个数图片
@property (strong, nonatomic) screeningButton *StyleButton;//风格按钮
@property (strong, nonatomic) screeningButton *SpaceButton;//房型按钮
/**
* 当前页数
*/
@property (nonatomic,assign) int indexPage;
@end
......@@ -16,26 +16,57 @@
- (void)viewDidLoad {
[self initdata];
[self getdatasAction];
[self initView ];
[self uiConfigAction];
[self getdatasAction];
}
-(void)initdata
{
self.arrayData=[[NSArray alloc]init];
self.arrayData=[[NSMutableArray alloc]init];
self.indexPage = 0;
}
-(void)uiConfigAction
{
//下拉刷新
MjRefreshHeaderCustom *headerRefresh = [MjRefreshHeaderCustom 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];
}];
headerRefresh.stateLabel.hidden = YES;
headerRefresh.lastUpdatedTimeLabel.hidden = YES;
self.collectionView.mj_header = headerRefresh;
[self.collectionView.mj_header beginRefreshing];
//上拉加载
self.collectionView.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];
}];
}
#pragma mark -获取场景筛选数据
- (void)getdatasAction
{
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/scene/getSceneFilter"] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
self.filter = [[SceneFilter alloc]initWithDictionary:returnValue[@"data"] error:nil];
self.arrayData=self.filter.styles;
self.arrayData=[NSMutableArray arrayWithArray:self.filter.styles];
[self.seceneTableView reloadData];
}
else
......@@ -52,16 +83,20 @@
//
//
#pragma mark -获取场景列表数据
- (void)getSceneLibrarydatas:(SceneCondition *)condition
- (void)getSceneLibrarydatas:(SceneCondition *)condition isRemove:(BOOL)remove
{
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/scene/query"] WithRequestType:0 WithParameter:condition WithReturnValueBlock:^(id returnValue) {
[self endRefreshingForTableView:self.collectionView];
[self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
// if (remove) {
// [self.responseArray removeAllObjects];
// }
self.response = [[SceneResponse alloc]initWithDictionary:returnValue[@"data"] error:nil];
NSArray* array=[[NSArray alloc]init];
array=self.response.list;
[ self.collectionView reloadData];
}
else
......@@ -74,6 +109,7 @@
} WithFailureBlock:^(id error) {
[self RemoveMBProgressHUDLoding];
[self endRefreshingForTableView:self.collectionView];
}];
}
......@@ -105,18 +141,6 @@
self.fengGeBtn.layer.masksToBounds = YES;
self.fengGeBtn.layer.cornerRadius = 15;
[self.view addSubview:self.fengGeBtn];
// //类型
// self.leiXingBtn=[UIButton buttonWithType:UIButtonTypeCustom];
// self.leiXingBtn.frame=CGRectMake(ScreenWidth-250, 152, 100, 46) ;
// self.leiXingBtn.backgroundColor=[UIColor whiteColor];
// [self.leiXingBtn setTitle:@"类型 " forState:UIControlStateNormal];
// [self.leiXingBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
// self.leiXingBtn.contentEdgeInsets = UIEdgeInsetsMake(0, 60, 0, 0);
// [self.leiXingBtn addTarget:self action:@selector(selectedType:) forControlEvents:UIControlEventTouchUpInside];
// self.leiXingBtn.tag=103;
// self.leiXingBtn.layer.masksToBounds = YES;
// self.leiXingBtn.layer.cornerRadius = 15;
// [self.view addSubview:self.leiXingBtn];
self.subView=[[UIView alloc]initWithFrame:CGRectMake(100, 50, ScreenWidth-300, ScreenHeight-200)];
self.subView.backgroundColor=[UIColor whiteColor];
......@@ -129,13 +153,7 @@
tap.cancelsTouchesInView = NO;
[[UIApplication sharedApplication].keyWindow addGestureRecognizer:tap];
[self initSubViews];
//默认数据
SceneCondition *condition = [[SceneCondition alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = 0;
condition.page = page;
[self getSceneLibrarydatas:condition];
}
-(void)initSubViews
{
......@@ -173,11 +191,11 @@
switch (sender.tag) {
case 101:
// 空间
self.arrayData=self.filter.space;;
self.arrayData=[NSMutableArray arrayWithArray:self.filter.space];
break;
case 102:
// 风格
self.arrayData=self.filter.styles;;
self.arrayData=[NSMutableArray arrayWithArray:self.filter.styles];
break;
case 103:
// 类型
......@@ -207,7 +225,19 @@
//定义展示的UICollectionViewCell的个数
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
// if (self.response.list.count<3) {
// return self.response.list.count;
// }else
// {
// if (self.response.list.count/section==0) {
// return 3;
// }else
// {
// return self.response.list.count%section;
// }
// }
return 3;
}
//每个UICollectionView展示的内容
......@@ -286,19 +316,22 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//选择数据
self.indexPage=0;
//默认数据
SceneCondition *condition = [[SceneCondition alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = 0;
page.page = self.indexPage;
page.rows = 10;
condition.page = page;
[self getSceneLibrarydatas:condition];
[self getSceneLibrarydatas:condition isRemove:NO];
}
-(void)DismissScreenView:(UITapGestureRecognizer*)sender{
CGPoint point = [sender locationInView:self.view];
if (point.x<100 || point.x >ScreenWidth-100||point.y<50||point.y>ScreenHeight-150) {
if (point.x<100 || point.x >ScreenWidth-150||point.y<50||point.y>ScreenHeight-150) {
if (self) {
[self.view removeFromSuperview];
......
//
// ShoppingCell.h
// Lighting
//
// Created by mac on 16/5/23.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "ShopcarModel.h"
@interface ShoppingCell : UITableViewCell
/**
* 选中
*/
@property (strong, nonatomic) UIButton *selectedButton;
/**
* 商品图片
*/
@property (strong, nonatomic) UIImageView *goodsImageView;
/**
* 商品信息
*/
@property (strong, nonatomic) UILabel *goodsInformationLabe;
/**
* 吊牌价格
*/
@property (strong, nonatomic) UILabel *tagsPriceLabe;
/**
* 成交价格
*/
@property (strong, nonatomic) UITextField *clinchTextfield;
/**
* 减号
*/
@property (strong, nonatomic) UIButton *reduceButton;
/**
* 商品数量
*/
@property (strong, nonatomic) UILabel *goodsNumbersLabe;
/**
* 加号
*/
@property (strong, nonatomic) UIButton *addButton;
/**
* 产品金额
*/
@property (strong, nonatomic) UILabel *productPriceLabe;
/**
* 数据源model
*/
@property (nonatomic,strong) ShopcarModel *model;
/**
* 传入cel下标
*/
@property (nonatomic,assign) NSInteger cellindex;
/**
* 传回选中状态
*/
@property (nonatomic,copy) void(^returnCellblock)(NSInteger index);
//选中索引
//@property (strong, nonatomic) NSIndexPath *indexpath;
/**
* 成交价背景View
*/
@property (strong, nonatomic) UIView *ClinchPriceBackView;
/**
* 商品数量
*/
//@property (nonatomic,assign) id<ChangeGoodsNumberDelegate>delegate;
@end
//
// ShoppingCell.m
// Lighting
//
// Created by mac on 16/5/23.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "ShoppingCell.h"
#define Width 800
#define Height self.frame.size.height
#define Gap 5
@implementation ShoppingCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self bulidLayout];
}
return self;
}
- (void)bulidLayout
{
// 选中
self.selectedButton=[[UIButton alloc]initWithFrame:CGRectMake(10, 10, Width/15-20, Height-20)];
[self.selectedButton setBackgroundImage:[UIImage imageNamed:@"box-副本"] forState:UIControlStateNormal];
// box-副本
[self.contentView addSubview:self.selectedButton];
// 商品图片
self.goodsImageView=[[UIImageView alloc]initWithFrame:CGRectMake(Width/15, 0, 2*Width/15, Height)];
self.goodsImageView.image=[UIImage imageNamed:@"05产品库-详情_03"];
//05产品库-详情_03
[self.contentView addSubview:self.goodsImageView];
// 商品信息
self.goodsInformationLabe=[[UILabel alloc]initWithFrame:CGRectMake(3*Width/15, 0, 3*Width/15, Height)];
self.goodsInformationLabe.text=@"吊灯jkdsfhkdhfkdsh\n2000133434";
self.goodsInformationLabe.numberOfLines=0;
[self.contentView addSubview:self.goodsInformationLabe];
// 吊牌价格
self.tagsPriceLabe=[[UILabel alloc]initWithFrame:CGRectMake(6*Width/15, 0,2*Width/15, Height)];
self.tagsPriceLabe.text=@"$5500";
[self.contentView addSubview:self.tagsPriceLabe];
// 成交价格
self.clinchTextfield=[[UITextField alloc]initWithFrame:CGRectMake(8*Width/15, 0, 2*Width/15, Height)];
self.clinchTextfield.text=@"$5500";
[self.contentView addSubview:self.clinchTextfield];
// 数量减
self.reduceButton=[[UIButton alloc]initWithFrame:CGRectMake(10*Width/15, 0, Width/15, Height)];
[self.reduceButton setTitle:@"-" forState:UIControlStateNormal];
[self.reduceButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
self.reduceButton.titleLabel.font= [UIFont systemFontOfSize: 18.0];
[self.contentView addSubview:self.reduceButton];
// 商品数量
self.goodsNumbersLabe=[[UILabel alloc]initWithFrame:CGRectMake(11*Width/15, 0, Width/15, Height)];
self.goodsNumbersLabe.text=@"1";
self.goodsNumbersLabe.textAlignment=NSTextAlignmentCenter;
[self.contentView addSubview:self.goodsNumbersLabe];
// 数量加
self.addButton=[[UIButton alloc]initWithFrame:CGRectMake(12*Width/15, 0, Width/15, Height)];
[self.addButton setTitle:@"+" forState:UIControlStateNormal];
[self.addButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
self.addButton.titleLabel.font= [UIFont systemFontOfSize: 18.0];
[self.contentView addSubview:self.addButton];
// 产品金额
self.productPriceLabe=[[UILabel alloc]initWithFrame:CGRectMake(13*Width/15, 0, 2*Width/15, Height)];
self.productPriceLabe.text=@"$5500";
self.productPriceLabe.textColor=[UIColor redColor];
[self.contentView addSubview:self.productPriceLabe];
}
- (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
//
// ShoppingView.h
// Lighting
//
// Created by mac on 16/5/23.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
#import "ShoppingCell.h"
@interface ShoppingView : BaseViewController<UIGestureRecognizerDelegate,UITableViewDelegate,UITableViewDataSource>
@property (nonatomic,strong) UIView *subView;
@property (nonatomic,strong) UIView *headerView;
@property (nonatomic,strong) UIView *toolView;
@property (nonatomic,strong) UIView *footView;
@property (nonatomic,strong) NSMutableArray *nameDataArray;
@property (nonatomic,strong) NSMutableArray *productModelArray;
@property (nonatomic,strong) NSMutableArray *selectTagArray;
@property (nonatomic,strong) UITableView *shoppingTableView;
@property (nonatomic,assign) BOOL isAllSelected;
@end
\ No newline at end of file
This diff is collapsed.
......@@ -11,15 +11,7 @@
@protocol ImageCropperDelegate;
@interface ImageCropperView : UIImageView {
UIImageView *imageView;
}
@property (nonatomic, retain) UIImage *image;
@property (nonatomic, retain) UIImage *croppedImage;
@interface ImageCropperView : UIImageView
@property (nonatomic, assign) id <ImageCropperDelegate> delegate;
- (void)setup;
......
......@@ -14,17 +14,12 @@
#import "UIImage+Rotation.h"
@interface ImageCropperView()
{
@private
CGSize _originalImageViewSize;
}
@property (nonatomic, retain) UIImageView *imageView;
@end
@implementation ImageCropperView
@synthesize imageView, image = _image, delegate, croppedImage;
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
......@@ -110,61 +105,61 @@
}
}
float _lastTransX = 0.0, _lastTransY = 0.0;
- (void)moveImage:(UIPanGestureRecognizer *)sender
{
CGPoint translatedPoint = [sender translationInView:self];
if([sender state] == UIGestureRecognizerStateBegan) {
_lastTransX = 0.0;
_lastTransY = 0.0;
}
CGAffineTransform trans = CGAffineTransformMakeTranslation(translatedPoint.x - _lastTransX, translatedPoint.y - _lastTransY);
CGAffineTransform newTransform = CGAffineTransformConcat(self.transform, trans);
_lastTransX = translatedPoint.x;
_lastTransY = translatedPoint.y;
self.transform = newTransform;
}
float _lastScale = 1.0;
- (void)scaleImage:(UIPinchGestureRecognizer *)sender
{
if([sender state] == UIGestureRecognizerStateBegan) {
_lastScale = 2.0;
return;
}
CGFloat scale = [sender scale]/_lastScale;
CGAffineTransform currentTransform = self.transform;
CGAffineTransform newTransform = CGAffineTransformScale(currentTransform, scale, scale);
[self setTransform:newTransform];
_lastScale = [sender scale];
}
float _lastRotation = 0.0;
//旋转
- (void)rotateImage:(UIRotationGestureRecognizer *)sender
{
if([sender state] == UIGestureRecognizerStateEnded) {
_lastRotation = 0.0;
return;
}
CGFloat rotation = -_lastRotation + [sender rotation];
CGAffineTransform currentTransform = self.transform;
CGAffineTransform newTransform = CGAffineTransformRotate(currentTransform,rotation);
[self setTransform:newTransform];
_lastRotation = [sender rotation];
}
//float _lastTransX = 0.0, _lastTransY = 0.0;
//- (void)moveImage:(UIPanGestureRecognizer *)sender
//{
// CGPoint translatedPoint = [sender translationInView:self];
//
// if([sender state] == UIGestureRecognizerStateBegan) {
// _lastTransX = 0.0;
// _lastTransY = 0.0;
// }
//
// CGAffineTransform trans = CGAffineTransformMakeTranslation(translatedPoint.x - _lastTransX, translatedPoint.y - _lastTransY);
// CGAffineTransform newTransform = CGAffineTransformConcat(self.transform, trans);
// _lastTransX = translatedPoint.x;
// _lastTransY = translatedPoint.y;
//
// self.transform = newTransform;
//}
//
//float _lastScale = 1.0;
//- (void)scaleImage:(UIPinchGestureRecognizer *)sender
//{
// if([sender state] == UIGestureRecognizerStateBegan) {
//
// _lastScale = 2.0;
// return;
// }
//
// CGFloat scale = [sender scale]/_lastScale;
//
// CGAffineTransform currentTransform = self.transform;
// CGAffineTransform newTransform = CGAffineTransformScale(currentTransform, scale, scale);
// [self setTransform:newTransform];
//
// _lastScale = [sender scale];
//}
//
//float _lastRotation = 0.0;
////旋转
//- (void)rotateImage:(UIRotationGestureRecognizer *)sender
//{
// if([sender state] == UIGestureRecognizerStateEnded) {
//
// _lastRotation = 0.0;
// return;
// }
//
// CGFloat rotation = -_lastRotation + [sender rotation];
//
// CGAffineTransform currentTransform = self.transform;
// CGAffineTransform newTransform = CGAffineTransformRotate(currentTransform,rotation);
// [self setTransform:newTransform];
//
// _lastRotation = [sender rotation];
//
//}
//长按响应的事件
-(void)handleLongPress2:(id)sender{
......
......@@ -16,6 +16,8 @@
04A14A251CE0FC3A00DAD5F3 /* LeftSubView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04A14A241CE0FC3A00DAD5F3 /* LeftSubView.m */; };
04A14A281CE0FC5600DAD5F3 /* RightSubView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04A14A271CE0FC5600DAD5F3 /* RightSubView.m */; };
04A14A2B1CE0FC7F00DAD5F3 /* FootSubView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04A14A2A1CE0FC7F00DAD5F3 /* FootSubView.m */; };
04F9EE181CF2235000BD729F /* ShoppingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04F9EE171CF2235000BD729F /* ShoppingView.m */; };
04F9EE1B1CF22B5900BD729F /* ShoppingCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 04F9EE1A1CF22B5900BD729F /* ShoppingCell.m */; };
060D397C1CE45CFE0082AECD /* ImageCropperView.m in Sources */ = {isa = PBXBuildFile; fileRef = 060D39791CE45CFE0082AECD /* ImageCropperView.m */; };
060D397D1CE45CFE0082AECD /* UIImage+Rotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 060D397B1CE45CFE0082AECD /* UIImage+Rotation.m */; };
2906B5D71CD89246000849B4 /* ClientDetailsTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2906B5D61CD89246000849B4 /* ClientDetailsTableViewCell.m */; };
......@@ -147,6 +149,10 @@
04A14A271CE0FC5600DAD5F3 /* RightSubView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RightSubView.m; sourceTree = "<group>"; };
04A14A291CE0FC7F00DAD5F3 /* FootSubView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FootSubView.h; sourceTree = "<group>"; };
04A14A2A1CE0FC7F00DAD5F3 /* FootSubView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FootSubView.m; sourceTree = "<group>"; };
04F9EE161CF2235000BD729F /* ShoppingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShoppingView.h; sourceTree = "<group>"; };
04F9EE171CF2235000BD729F /* ShoppingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShoppingView.m; sourceTree = "<group>"; };
04F9EE191CF22B5900BD729F /* ShoppingCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShoppingCell.h; sourceTree = "<group>"; };
04F9EE1A1CF22B5900BD729F /* ShoppingCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShoppingCell.m; sourceTree = "<group>"; };
060D39781CE45CFE0082AECD /* ImageCropperView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageCropperView.h; sourceTree = "<group>"; };
060D39791CE45CFE0082AECD /* ImageCropperView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageCropperView.m; sourceTree = "<group>"; };
060D397A1CE45CFE0082AECD /* UIImage+Rotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+Rotation.h"; sourceTree = "<group>"; };
......@@ -407,6 +413,8 @@
0470D6101CE2936000647F0F /* SeceneLibraryView.m */,
0470D6121CE2938000647F0F /* ProductLibraryView.h */,
0470D6131CE2938000647F0F /* ProductLibraryView.m */,
04F9EE161CF2235000BD729F /* ShoppingView.h */,
04F9EE171CF2235000BD729F /* ShoppingView.m */,
);
name = subView;
sourceTree = "<group>";
......@@ -438,6 +446,8 @@
044CD6ED1CEB771C0004A715 /* SeceneCollectionPictureCell.m */,
044CD6EF1CEB81350004A715 /* ProductCollectionPictureCell.h */,
044CD6F01CEB81350004A715 /* ProductCollectionPictureCell.m */,
04F9EE191CF22B5900BD729F /* ShoppingCell.h */,
04F9EE1A1CF22B5900BD729F /* ShoppingCell.m */,
);
name = customCell;
sourceTree = "<group>";
......@@ -1397,7 +1407,9 @@
290887131CE5DF16000B7097 /* ShopcarModel.m in Sources */,
29BB27681CD9D38E009A0813 /* AllpriceTableViewCell.m in Sources */,
29BB27771CD9DFBA009A0813 /* ProductLibraryViewController.m in Sources */,
04F9EE181CF2235000BD729F /* ShoppingView.m in Sources */,
29EAAEAA1CDC7FE800C4DBA2 /* AllCutomerTableViewCell.m in Sources */,
04F9EE1B1CF22B5900BD729F /* ShoppingCell.m in Sources */,
29360C2F1CDDC47E002A5D89 /* ScreeningView.m in Sources */,
2985AEA21CE72F1500704C91 /* NSDictionary+ZXPUnicode.m in Sources */,
29EAAE9C1CDC74CA00C4DBA2 /* AllCustomerViewController.m in Sources */,
......
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model name="Test1.xcdatamodel" userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="1" systemVersion="11A491" minimumToolsVersion="Automatic" macOSVersion="Automatic" iOSVersion="Automatic">
<elements/>
<model userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="10171" systemVersion="15E65" minimumToolsVersion="Automatic">
<entity name="Entity" syncable="YES"/>
<elements>
<element name="Entity" positionX="-63" positionY="-18" width="128" height="45"/>
</elements>
</model>
\ No newline at end of file
......@@ -14,7 +14,7 @@ PODS:
- AFNetworking/Serialization (3.1.0)
- AFNetworking/UIKit (3.1.0):
- AFNetworking/NSURLSession
- IQKeyboardManager (4.0.3)
- IQKeyboardManager (4.0.2)
- JSONModel (1.2.0)
- Masonry (0.6.4)
- MBProgressHUD (0.9.2)
......@@ -32,9 +32,9 @@ PODS:
- MMDrawerController/Core
- MMDrawerController/Subclass (0.6.0):
- MMDrawerController/Core
- SDWebImage (3.7.6):
- SDWebImage/Core (= 3.7.6)
- SDWebImage/Core (3.7.6)
- SDWebImage (3.7.5):
- SDWebImage/Core (= 3.7.5)
- SDWebImage/Core (3.7.5)
- SVProgressHUD (2.0.3)
DEPENDENCIES:
......@@ -51,14 +51,14 @@ DEPENDENCIES:
SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
IQKeyboardManager: be9695ffc5a52077deb4847608f338771022d6d1
IQKeyboardManager: 2341089c4ae25fa2fa82ce356a259fcd267dc6b6
JSONModel: 12523685c4b623553ccf844bbbf7007624317b2c
Masonry: 281802d04d787ea2973179ee8bcb50500579ede2
MBProgressHUD: 1569cf7ace17a8bac47aabfbb8580a49690386d1
MJExtension: d86aacb740c87519d20e3cca55b6fa4be6cc7548
MJRefresh: 743e6404967d1c2c688472ea3ecfde247d872db4
MMDrawerController: e3a54a5570388463ad3b36975251575b50c4e1a0
SDWebImage: c325cf02c30337336b95beff20a13df489ec0ec9
SDWebImage: 69c6303e3348fba97e03f65d65d4fbc26740f461
SVProgressHUD: b0830714205bea1317ea1a2ebc71e5633af334d4
COCOAPODS: 0.39.0
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