Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
Opple-iOS
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
Opple-iOS
Commits
81a8073c
Commit
81a8073c
authored
May 30, 2016
by
mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
搜索接口 购物车接口完善
parent
9aafd9da
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
201 additions
and
54 deletions
+201
-54
CustomShopingSeclectButton.h
Lighting/Class/CustomShopingSeclectButton.h
+13
-0
CustomShopingSeclectButton.m
Lighting/Class/CustomShopingSeclectButton.m
+21
-0
CustomTOGoodsEntity.h
Lighting/Class/CustomTOGoodsEntity.h
+14
-0
CustomTOGoodsEntity.m
Lighting/Class/CustomTOGoodsEntity.m
+13
-0
FollowHeartViewController.h
Lighting/Class/FollowHeartViewController.h
+2
-1
FollowHeartViewController.m
Lighting/Class/FollowHeartViewController.m
+12
-4
ProductLibraryView.m
Lighting/Class/ProductLibraryView.m
+4
-1
RightSubView.h
Lighting/Class/RightSubView.h
+1
-1
RightSubView.m
Lighting/Class/RightSubView.m
+2
-1
ShareViewController.m
Lighting/Class/ShareViewController.m
+1
-1
ShoppingCell.h
Lighting/Class/ShoppingCell.h
+4
-2
ShoppingCell.m
Lighting/Class/ShoppingCell.m
+18
-1
ShoppingView.h
Lighting/Class/ShoppingView.h
+1
-1
ShoppingView.m
Lighting/Class/ShoppingView.m
+37
-20
ImageCropperView.h
Lighting/Class/tools/ImageCropperView.h
+18
-6
ImageCropperView.m
Lighting/Class/tools/ImageCropperView.m
+4
-7
project.pbxproj
Lighting/Lighting.xcodeproj/project.pbxproj
+33
-5
Podfile.lock
Lighting/Podfile.lock
+1
-3
opple_objc_json_client.h
Lighting/Tools/opple_objc_json_client.h
+2
-0
No files found.
Lighting/Class/CustomShopingSeclectButton.h
0 → 100644
View file @
81a8073c
//
// CustomShopingSeclectButton.h
// Lighting
//
// Created by mac on 16/5/30.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface
CustomShopingSeclectButton
:
UIButton
@property
(
nonatomic
,
strong
)
NSIndexPath
*
customIndexPath
;
@end
Lighting/Class/CustomShopingSeclectButton.m
0 → 100644
View file @
81a8073c
//
// CustomShopingSeclectButton.m
// Lighting
//
// Created by mac on 16/5/30.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "CustomShopingSeclectButton.h"
@implementation
CustomShopingSeclectButton
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
Lighting/Class/CustomTOGoodsEntity.h
0 → 100644
View file @
81a8073c
//
// CustomTOGoodsEntity.h
// Lighting
//
// Created by mac on 16/5/30.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "opple_objc_json_client.h"
@interface
CustomTOGoodsEntity
:
NSObject
@property
(
nonatomic
,
strong
)
TOGoodsEntity
*
tOGoodsEntity
;
//商品
@property
(
nonatomic
,
strong
)
NSString
*
count
;
//商品数量
@end
Lighting/Class/CustomTOGoodsEntity.m
0 → 100644
View file @
81a8073c
//
// CustomTOGoodsEntity.m
// Lighting
//
// Created by mac on 16/5/30.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "CustomTOGoodsEntity.h"
@implementation
CustomTOGoodsEntity
@end
Lighting/Class/FollowHeartViewController.h
View file @
81a8073c
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
#import "ShareViewController.h"
#import "ShareViewController.h"
#import "CameraView.h"
#import "CameraView.h"
#import "HelpViewController.h"
#import "HelpViewController.h"
#import "ImageCropperView.h"
@protocol
FollowHeartViewAddpicturedelegate
<
NSObject
>
@protocol
FollowHeartViewAddpicturedelegate
<
NSObject
>
@required
@required
...
@@ -25,7 +26,7 @@
...
@@ -25,7 +26,7 @@
@end
@end
@interface
FollowHeartViewController
:
BaseViewController
<
LeftViewBtnClickdelegate
,
RightViewBtnClickdelegate
,
FootViewBtnClickdelegate
,
UIGestureRecognizerDelegate
,
AddSecenePicturedelegate
,
AddProductPicturedelegate
,
SharePicturedelegate
,
AddCustomPicturedelegate
,
Shoppingdelegate
>
@interface
FollowHeartViewController
:
BaseViewController
<
LeftViewBtnClickdelegate
,
RightViewBtnClickdelegate
,
FootViewBtnClickdelegate
,
UIGestureRecognizerDelegate
,
AddSecenePicturedelegate
,
AddProductPicturedelegate
,
SharePicturedelegate
,
AddCustomPicturedelegate
,
Shoppingdelegate
,
ImageCropperDelegate
>
@property
(
nonatomic
,
assign
)
id
<
FollowHeartViewAddpicturedelegate
>
delegate
;
@property
(
nonatomic
,
assign
)
id
<
FollowHeartViewAddpicturedelegate
>
delegate
;
@property
(
nonatomic
,
strong
)
LeftSubView
*
leftSubView
;
@property
(
nonatomic
,
strong
)
LeftSubView
*
leftSubView
;
@property
(
nonatomic
,
strong
)
RightSubView
*
rightSubView
;
@property
(
nonatomic
,
strong
)
RightSubView
*
rightSubView
;
...
...
Lighting/Class/FollowHeartViewController.m
View file @
81a8073c
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#import "FollowHeartViewController.h"
#import "FollowHeartViewController.h"
#import <QuartzCore/QuartzCore.h>
#import <QuartzCore/QuartzCore.h>
#import "ImageCropperView.h"
@interface
FollowHeartViewController
()
@interface
FollowHeartViewController
()
...
@@ -136,13 +136,21 @@
...
@@ -136,13 +136,21 @@
{
{
self
.
backGroundImageView
.
image
=
image
;
self
.
backGroundImageView
.
image
=
image
;
}
}
//添加产品图
//添加
场景中
产品图
-
(
void
)
resetSubProductImage
:
(
UIImage
*
)
image
productModel
:
(
NSMutableArra
y
*
)
productModel
-
(
void
)
resetSubProductImage
:
(
UIImage
*
)
image
productModel
:
(
TOGoodsEntit
y
*
)
productModel
{
{
self
.
productModelArray
=
productModel
;
ImageCropperView
*
cropper
=
[[
ImageCropperView
alloc
]
initWithFrame
:
CGRectMake
(
400
,
200
,
300
,
225
)];
ImageCropperView
*
cropper
=
[[
ImageCropperView
alloc
]
initWithFrame
:
CGRectMake
(
400
,
200
,
300
,
225
)];
cropper
.
image
=
image
;
cropper
.
image
=
image
;
cropper
.
GoodsEntity
=
productModel
;
cropper
.
delegate
=
self
;
[
self
.
view
addSubview
:
cropper
];
[
self
.
view
addSubview
:
cropper
];
[
self
.
productModelArray
addObject
:
cropper
.
GoodsEntity
];
}
//删除场景中产品回调
-
(
void
)
removeSelfObject
:
(
ImageCropperView
*
)
Cropper
{
[
self
.
productModelArray
removeObject
:
Cropper
.
GoodsEntity
];
[
Cropper
removeFromSuperview
];
}
}
//场景库选图回调
//场景库选图回调
-
(
void
)
addSeceneImage
:
(
UIImage
*
)
image
-
(
void
)
addSeceneImage
:
(
UIImage
*
)
image
...
...
Lighting/Class/ProductLibraryView.m
View file @
81a8073c
...
@@ -625,10 +625,13 @@
...
@@ -625,10 +625,13 @@
[
self
SHOWPrompttext
:
@"请先输入搜索关键字"
];
[
self
SHOWPrompttext
:
@"请先输入搜索关键字"
];
}
else
}
else
{
{
[
self
SHOWPrompttext
:
@"接口文档地址打不开 待调试"
];
self
.
condtionModel
.
nameLike
=
self
.
searchTextField
.
text
;
[
self
.
collectionView
.
mj_header
beginRefreshing
];
}
}
}
}
-
(
void
)
DismissScreenView
:
(
UITapGestureRecognizer
*
)
sender
{
-
(
void
)
DismissScreenView
:
(
UITapGestureRecognizer
*
)
sender
{
CGPoint
point
=
[
sender
locationInView
:
self
.
view
];
CGPoint
point
=
[
sender
locationInView
:
self
.
view
];
if
(
point
.
x
<
100
||
point
.
x
>
ScreenWidth
-
150
||
point
.
y
<
50
||
point
.
y
>
ScreenHeight
-
150
)
{
if
(
point
.
x
<
100
||
point
.
x
>
ScreenWidth
-
150
||
point
.
y
<
50
||
point
.
y
>
ScreenHeight
-
150
)
{
...
...
Lighting/Class/RightSubView.h
View file @
81a8073c
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
//回调
//回调
-
(
void
)
buttonClick
:
(
NSInteger
)
btnTag
withButton
:
(
UIButton
*
)
button
;
-
(
void
)
buttonClick
:
(
NSInteger
)
btnTag
withButton
:
(
UIButton
*
)
button
;
-
(
void
)
resetSubProductImage
:(
UIImage
*
)
image
productModel
:(
NSMutableArra
y
*
)
productModel
;
-
(
void
)
resetSubProductImage
:(
UIImage
*
)
image
productModel
:(
TOGoodsEntit
y
*
)
productModel
;
@end
@end
@interface
RightSubView
:
UIView
@interface
RightSubView
:
UIView
...
...
Lighting/Class/RightSubView.m
View file @
81a8073c
...
@@ -70,7 +70,7 @@
...
@@ -70,7 +70,7 @@
NSLog
(
@"%d"
,(
sender
.
tag
));
NSLog
(
@"%d"
,(
sender
.
tag
));
if
([
self
.
delegate
respondsToSelector
:
@selector
(
resetSubProductImage
:
productModel
:
)])
{
if
([
self
.
delegate
respondsToSelector
:
@selector
(
resetSubProductImage
:
productModel
:
)])
{
[
self
.
delegate
resetSubProductImage
:
sender
.
imageView
.
image
productModel
:
self
.
productModelArray
];
[
self
.
delegate
resetSubProductImage
:
sender
.
imageView
.
image
productModel
:
[
self
.
productModelArray
objectAtIndex
:
sender
.
tag
-
100
]
];
}
}
// resetSuperBackGroundImage
// resetSuperBackGroundImage
...
@@ -83,6 +83,7 @@
...
@@ -83,6 +83,7 @@
NSInteger
index
=
longPress
.
view
.
tag
-
100
;
NSInteger
index
=
longPress
.
view
.
tag
-
100
;
if
(
self
.
dataArray
.
count
>
index
)
{
if
(
self
.
dataArray
.
count
>
index
)
{
[
self
.
dataArray
removeObjectAtIndex
:
index
];
[
self
.
dataArray
removeObjectAtIndex
:
index
];
[
self
.
productModelArray
removeObjectAtIndex
:
index
];
[
self
showProductPicture
];
[
self
showProductPicture
];
}
}
...
...
Lighting/Class/ShareViewController.m
View file @
81a8073c
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
}
}
-
(
void
)
sharePicture
:
(
UIButton
*
)
sender
-
(
void
)
sharePicture
:
(
UIButton
*
)
sender
{
{
if
([
self
.
delegate
respondsToSelector
:
@selector
(
addProductImage
:
productModel
:
)])
{
if
([
self
.
delegate
respondsToSelector
:
@selector
(
ShareProductImage
:)])
{
[
self
.
delegate
ShareProductImage
:
nil
];
[
self
.
delegate
ShareProductImage
:
nil
];
}
}
...
...
Lighting/Class/ShoppingCell.h
View file @
81a8073c
...
@@ -8,11 +8,13 @@
...
@@ -8,11 +8,13 @@
#import <UIKit/UIKit.h>
#import <UIKit/UIKit.h>
#import "ShopcarModel.h"
#import "ShopcarModel.h"
#import "CustomTOGoodsEntity.h"
#import "CustomShopingSeclectButton.h"
@interface
ShoppingCell
:
UITableViewCell
@interface
ShoppingCell
:
UITableViewCell
/**
/**
* 选中
* 选中
*/
*/
@property
(
strong
,
nonatomic
)
UI
Button
*
selectedButton
;
@property
(
strong
,
nonatomic
)
CustomShopingSeclect
Button
*
selectedButton
;
/**
/**
* 商品图片
* 商品图片
...
@@ -60,7 +62,7 @@
...
@@ -60,7 +62,7 @@
* 数据源model
* 数据源model
*/
*/
@property
(
nonatomic
,
strong
)
ShopcarModel
*
model
;
@property
(
nonatomic
,
strong
)
ShopcarModel
*
model
;
@property
(
nonatomic
,
strong
)
CustomTOGoodsEntity
*
customGoods
;
@property
(
nonatomic
,
assign
)
int
value
;
@property
(
nonatomic
,
assign
)
int
value
;
...
...
Lighting/Class/ShoppingCell.m
View file @
81a8073c
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
self
=
[
super
initWithStyle
:
style
reuseIdentifier
:
reuseIdentifier
];
self
=
[
super
initWithStyle
:
style
reuseIdentifier
:
reuseIdentifier
];
if
(
self
)
{
if
(
self
)
{
self
.
value
=
1
;
self
.
value
=
1
;
self
.
customGoods
=
[[
CustomTOGoodsEntity
alloc
]
init
];
[
self
bulidLayout
];
[
self
bulidLayout
];
}
}
return
self
;
return
self
;
...
@@ -25,7 +26,7 @@
...
@@ -25,7 +26,7 @@
-
(
void
)
bulidLayout
-
(
void
)
bulidLayout
{
{
// 选中
// 选中
self
.
selectedButton
=
[[
UI
Button
alloc
]
initWithFrame
:
CGRectMake
(
20
,
25
,
Width
/
12
-
40
,
Height
-
50
)];
self
.
selectedButton
=
[[
CustomShopingSeclect
Button
alloc
]
initWithFrame
:
CGRectMake
(
20
,
25
,
Width
/
12
-
40
,
Height
-
50
)];
[
self
.
selectedButton
setBackgroundImage
:[
UIImage
imageNamed
:
@"box-副本"
]
forState
:
UIControlStateNormal
];
[
self
.
selectedButton
setBackgroundImage
:[
UIImage
imageNamed
:
@"box-副本"
]
forState
:
UIControlStateNormal
];
// box-副本
// box-副本
[
self
.
contentView
addSubview
:
self
.
selectedButton
];
[
self
.
contentView
addSubview
:
self
.
selectedButton
];
...
@@ -94,6 +95,7 @@
...
@@ -94,6 +95,7 @@
case
100
:
//减少
case
100
:
//减少
{
{
if
(
self
.
value
<=
1
)
{
if
(
self
.
value
<=
1
)
{
[
self
ErrorMBProgressView
:
@"不能小于1"
];
return
;
return
;
}
else
}
else
{
{
...
@@ -105,6 +107,8 @@
...
@@ -105,6 +107,8 @@
break
;
break
;
case
200
:
//增加
case
200
:
//增加
{
{
// //不能大于库存
// [self ErrorMBProgressView:@"超过库存"];
self
.
value
+=
1
;
self
.
value
+=
1
;
}
}
...
@@ -115,6 +119,19 @@
...
@@ -115,6 +119,19 @@
}
}
self
.
goodsNumbersLabe
.
text
=
[
NSString
stringWithFormat
:
@"%d"
,
self
.
value
];
self
.
goodsNumbersLabe
.
text
=
[
NSString
stringWithFormat
:
@"%d"
,
self
.
value
];
}
}
#pragma mark -显示错误的提示框
-
(
void
)
ErrorMBProgressView
:
(
NSString
*
)
errorString
{
MBProgressHUD
*
hud
=
[
MBProgressHUD
showHUDAddedTo
:
self
.
superview
animated
:
YES
];
hud
.
labelText
=
errorString
;
hud
.
margin
=
10
.
f
;
hud
.
color
=
[[
UIColor
blackColor
]
colorWithAlphaComponent
:
0
.
5
];
hud
.
minSize
=
CGSizeMake
(
250
,
70
);
hud
.
animationType
=
MBProgressHUDAnimationZoom
;
hud
.
mode
=
MBProgressHUDModeText
;
hud
.
removeFromSuperViewOnHide
=
YES
;
[
hud
hide
:
YES
afterDelay
:
1
.
0
f
];
}
-
(
void
)
awakeFromNib
{
-
(
void
)
awakeFromNib
{
[
super
awakeFromNib
];
[
super
awakeFromNib
];
// Initialization code
// Initialization code
...
...
Lighting/Class/ShoppingView.h
View file @
81a8073c
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#import "BaseViewController.h"
#import "BaseViewController.h"
#import "ShoppingCell.h"
#import "ShoppingCell.h"
//#import "TOGoodsEntity
.h"
#import "CustomShopingSeclectButton
.h"
@protocol
Shoppingdelegate
<
NSObject
>
@protocol
Shoppingdelegate
<
NSObject
>
@required
@required
...
...
Lighting/Class/ShoppingView.m
View file @
81a8073c
...
@@ -165,8 +165,10 @@
...
@@ -165,8 +165,10 @@
[
self
.
shoppingTableView
reloadData
];
[
self
.
shoppingTableView
reloadData
];
}
}
//选择
//选择
-
(
void
)
selfctAtIndexpath
:
(
UI
Button
*
)
sender
-
(
void
)
selfctAtIndexpath
:
(
CustomShopingSeclect
Button
*
)
sender
{
{
NSArray
*
cellArray
=
self
.
shoppingTableView
.
visibleCells
;
ShoppingCell
*
cell
=
[
self
.
shoppingTableView
cellForRowAtIndexPath
:
sender
.
customIndexPath
];
if
([
self
.
selectTagArray
containsObject
:[
NSString
stringWithFormat
:
@"%d"
,
sender
.
tag
]])
{
if
([
self
.
selectTagArray
containsObject
:[
NSString
stringWithFormat
:
@"%d"
,
sender
.
tag
]])
{
[
sender
setBackgroundImage
:[
UIImage
imageNamed
:
@"box-副本"
]
forState
:
UIControlStateNormal
];
[
sender
setBackgroundImage
:[
UIImage
imageNamed
:
@"box-副本"
]
forState
:
UIControlStateNormal
];
[
self
.
selectTagArray
removeObject
:[
NSString
stringWithFormat
:
@"%d"
,
sender
.
tag
]];
[
self
.
selectTagArray
removeObject
:[
NSString
stringWithFormat
:
@"%d"
,
sender
.
tag
]];
...
@@ -191,7 +193,6 @@
...
@@ -191,7 +193,6 @@
-
(
NSMutableArray
*
)
sequenceProductList
:
(
NSMutableArray
*
)
productList
-
(
NSMutableArray
*
)
sequenceProductList
:
(
NSMutableArray
*
)
productList
{
{
// 数组排序
// 数组排序
NSComparator
cmptr
=
^
(
id
obj1
,
id
obj2
){
NSComparator
cmptr
=
^
(
id
obj1
,
id
obj2
){
if
([
obj1
integerValue
]
<
[
obj2
integerValue
])
{
if
([
obj1
integerValue
]
<
[
obj2
integerValue
])
{
...
@@ -210,7 +211,7 @@
...
@@ -210,7 +211,7 @@
return
productList
;
return
productList
;
}
}
//加入购物车
-
(
void
)
addProducts
:
(
UIButton
*
)
sender
-
(
void
)
addProducts
:
(
UIButton
*
)
sender
{
{
//加入购物车
//加入购物车
...
@@ -220,32 +221,45 @@
...
@@ -220,32 +221,45 @@
[
self
ErrorMBProgressView
:
@"必须设置当前客户"
];
[
self
ErrorMBProgressView
:
@"必须设置当前客户"
];
return
;
return
;
}
}
for
(
int
i
=
0
;
i
<
self
.
AddArray
.
count
;
i
++
)
{
SaveShoppingCartRequest
*
shopCar
=
[[
SaveShoppingCartRequest
alloc
]
init
];
TOGoodsEntity
*
model
=
[
self
.
AddArray
objectAtIndex_opple
:
i
];
shopCar
.
consumerId
=
[[
Customermanager
manager
]
customerID
];
[
self
addGoodsShoppingbags
:
model
complate
:
^
{
shopCar
.
goodsId
=
@""
;
NSLog
(
@"加入购物车完成"
);
shopCar
.
count
=
@""
;
[
self
SHOWPrompttext
:
@"加入购物车成功"
];
for
(
int
i
=
0
;
i
<
self
.
shoppingTableView
.
visibleCells
.
count
;
i
++
)
{
}];
ShoppingCell
*
cell
=
[
self
.
shoppingTableView
.
visibleCells
objectAtIndex
:
i
];
if
(
[
self
.
selectTagArray
containsObject
:[
NSString
stringWithFormat
:
@"%d"
,
cell
.
selectedButton
.
tag
]]
)
{
TOGoodsEntity
*
model
=
cell
.
customGoods
.
tOGoodsEntity
;
if
(
!
[
shopCar
.
count
isEqualToString
:
@""
]
&&!
[
shopCar
.
goodsId
isEqualToString
:
@""
])
{
shopCar
.
goodsId
=
[
NSString
stringWithFormat
:
@"%@,%@"
,
shopCar
.
goodsId
,
model
.
fid
];
shopCar
.
count
=
[
NSString
stringWithFormat
:
@"%@,%d"
,
shopCar
.
count
,
cell
.
value
];
}
if
([
shopCar
.
goodsId
isEqualToString
:
@""
])
{
shopCar
.
goodsId
=
model
.
fid
;
}
if
([
shopCar
.
count
isEqualToString
:
@""
])
{
shopCar
.
count
=
[
NSString
stringWithFormat
:
@"%d"
,
cell
.
value
];
}
}
}
}
[
self
addGoodsShoppingbags
:
shopCar
complate
:
^
{
NSLog
(
@"加入购物车完成"
);
}];
}
}
#pragma mark -添加至购物车
#pragma mark -添加至购物车
-
(
void
)
addGoodsShoppingbags
:
(
TOGoodsEntity
*
)
model
complate
:
(
void
(
^
)())
response
-
(
void
)
addGoodsShoppingbags
:
(
SaveShoppingCartRequest
*
)
shopCar
complate
:
(
void
(
^
)())
response
{
{
SaveShoppingCartRequest
*
shopCar
=
[[
SaveShoppingCartRequest
alloc
]
init
];
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@"
,
ServerAddress
,
@"/shopcart/save"
]
WithRequestType
:
0
WithParameter
:
shopCar
WithReturnValueBlock
:^
(
id
returnValue
)
{
shopCar
.
consumerId
=
[[
Customermanager
manager
]
customerID
];
shopCar
.
goodsId
=
model
.
fid
;
shopCar
.
count
=
@"1"
;
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@"
,
ServerAddress
,
@"/shopcart/save"
]
WithRequestType
:
0
WithParameter
:
shopCar
WithReturnValueBlock
:^
(
id
returnValue
)
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
response
();
response
();
[
self
SuccessMBProgressView
:
@"添加购物车成功"
];
}
else
}
else
{
{
...
@@ -287,9 +301,12 @@
...
@@ -287,9 +301,12 @@
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
}
}
TOGoodsEntity
*
model
=
[
self
.
productModelArray
objectAtIndex
:
indexPath
.
row
];
cell
.
customGoods
.
tOGoodsEntity
=
model
;
cell
.
selectedButton
.
tag
=
indexPath
.
row
;
cell
.
selectedButton
.
tag
=
indexPath
.
row
;
cell
.
selectedButton
.
customIndexPath
=
indexPath
;
[
cell
.
selectedButton
addTarget
:
self
action
:
@selector
(
selfctAtIndexpath
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
cell
.
selectedButton
addTarget
:
self
action
:
@selector
(
selfctAtIndexpath
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
TOGoodsEntity
*
model
=
[
self
.
productModelArray
objectAtIndex
:
indexPath
.
row
];
NSArray
*
imageArray
=
[[[
self
.
productModelArray
objectAtIndex_opple
:
indexPath
.
row
]
pictures
]
componentsSeparatedByString
:
@","
];
NSArray
*
imageArray
=
[[[
self
.
productModelArray
objectAtIndex_opple
:
indexPath
.
row
]
pictures
]
componentsSeparatedByString
:
@","
];
[
cell
.
goodsImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:[
imageArray
firstObject
]]
placeholderImage
:
REPLACEIMAGE
];
[
cell
.
goodsImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:[
imageArray
firstObject
]]
placeholderImage
:
REPLACEIMAGE
];
...
...
Lighting/Class/tools/ImageCropperView.h
View file @
81a8073c
...
@@ -9,14 +9,26 @@
...
@@ -9,14 +9,26 @@
#import <UIKit/UIKit.h>
#import <UIKit/UIKit.h>
@protocol
ImageCropperDelegate
;
@class
ImageCropperView
;
@protocol
ImageCropperDelegate
<
NSObject
>
@required
//回调
-
(
void
)
removeSelfObject
:
(
ImageCropperView
*
)
Cropper
;
@end
@interface
ImageCropperView
:
UIImageView
@interface
ImageCropperView
:
UIImageView
@property
(
nonatomic
,
assign
)
id
<
ImageCropperDelegate
>
delegate
;
@property
(
nonatomic
,
assign
)
id
<
ImageCropperDelegate
>
delegate
;
@property
(
nonatomic
,
strong
)
TOGoodsEntity
*
GoodsEntity
;
-
(
void
)
setup
;
-
(
void
)
setup
;
@end
@protocol
ImageCropperDelegate
<
NSObject
>
@end
-
(
void
)
imageCropper
:
(
ImageCropperView
*
)
cropper
didFinishCroppingWithImage
:
(
UIImage
*
)
image
;
//
@end
//@protocol ImageCropperDelegate <NSObject>
\ No newline at end of file
//
//@required
//- (void)imageCropper:(ImageCropperView *)cropper didFinishCroppingWithImage:(UIImage *)image;
//- (void)removeSelfObject:(ImageCropperView*)Cropper;
//@end
Lighting/Class/tools/ImageCropperView.m
View file @
81a8073c
...
@@ -13,14 +13,9 @@
...
@@ -13,14 +13,9 @@
#import "UIImage+Rotation.h"
#import "UIImage+Rotation.h"
@interface
ImageCropperView
()
@end
@implementation
ImageCropperView
@implementation
ImageCropperView
-
(
id
)
initWithFrame
:(
CGRect
)
frame
{
-
(
id
)
initWithFrame
:(
CGRect
)
frame
{
self
=
[
super
initWithFrame
:
frame
];
self
=
[
super
initWithFrame
:
frame
];
...
@@ -162,8 +157,10 @@
...
@@ -162,8 +157,10 @@
//}
//}
//长按响应的事件
//长按响应的事件
-
(
void
)
handleLongPress2
:
(
id
)
sender
{
-
(
void
)
handleLongPress2
:
(
id
)
sender
{
if
([
self
.
delegate
respondsToSelector
:
@selector
(
removeSelfObject
:)])
{
[
self
removeFromSuperview
];
[
self
.
delegate
removeSelfObject
:
self
];
}
// [self removeFromSuperview];
}
}
...
...
Lighting/Lighting.xcodeproj/project.pbxproj
View file @
81a8073c
...
@@ -33,6 +33,8 @@
...
@@ -33,6 +33,8 @@
04F9EE1E1CF25F7300BD729F
/* ShareViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04F9EE1D1CF25F7300BD729F
/* ShareViewController.m */
;
};
04F9EE1E1CF25F7300BD729F
/* ShareViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04F9EE1D1CF25F7300BD729F
/* ShareViewController.m */
;
};
04F9EE221CF27B1D00BD729F
/* CoreTelephony.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04F9EE211CF27B1D00BD729F
/* CoreTelephony.framework */
;
};
04F9EE221CF27B1D00BD729F
/* CoreTelephony.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04F9EE211CF27B1D00BD729F
/* CoreTelephony.framework */
;
};
04FCB1A41CF60A8F0056093B
/* DeviceDirectionManager.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04FCB1A31CF60A8F0056093B
/* DeviceDirectionManager.m */
;
};
04FCB1A41CF60A8F0056093B
/* DeviceDirectionManager.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04FCB1A31CF60A8F0056093B
/* DeviceDirectionManager.m */
;
};
060A22311CFC518E00945BA4
/* CustomTOGoodsEntity.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
060A22301CFC518E00945BA4
/* CustomTOGoodsEntity.m */
;
};
060A22341CFC55C700945BA4
/* CustomShopingSeclectButton.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
060A22331CFC55C700945BA4
/* CustomShopingSeclectButton.m */
;
};
060D397C1CE45CFE0082AECD
/* ImageCropperView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
060D39791CE45CFE0082AECD
/* ImageCropperView.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 */
;
};
060D397D1CE45CFE0082AECD
/* UIImage+Rotation.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
060D397B1CE45CFE0082AECD
/* UIImage+Rotation.m */
;
};
2906B5D71CD89246000849B4
/* ClientDetailsTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2906B5D61CD89246000849B4
/* ClientDetailsTableViewCell.m */
;
};
2906B5D71CD89246000849B4
/* ClientDetailsTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2906B5D61CD89246000849B4
/* ClientDetailsTableViewCell.m */
;
};
...
@@ -191,6 +193,10 @@
...
@@ -191,6 +193,10 @@
04F9EE211CF27B1D00BD729F
/* CoreTelephony.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
CoreTelephony.framework
;
path
=
System/Library/Frameworks/CoreTelephony.framework
;
sourceTree
=
SDKROOT
;
};
04F9EE211CF27B1D00BD729F
/* CoreTelephony.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
CoreTelephony.framework
;
path
=
System/Library/Frameworks/CoreTelephony.framework
;
sourceTree
=
SDKROOT
;
};
04FCB1A21CF60A8F0056093B
/* DeviceDirectionManager.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
DeviceDirectionManager.h
;
sourceTree
=
"<group>"
;
};
04FCB1A21CF60A8F0056093B
/* DeviceDirectionManager.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
DeviceDirectionManager.h
;
sourceTree
=
"<group>"
;
};
04FCB1A31CF60A8F0056093B
/* DeviceDirectionManager.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
DeviceDirectionManager.m
;
sourceTree
=
"<group>"
;
};
04FCB1A31CF60A8F0056093B
/* DeviceDirectionManager.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
DeviceDirectionManager.m
;
sourceTree
=
"<group>"
;
};
060A222F1CFC518E00945BA4
/* CustomTOGoodsEntity.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
CustomTOGoodsEntity.h
;
sourceTree
=
"<group>"
;
};
060A22301CFC518E00945BA4
/* CustomTOGoodsEntity.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
CustomTOGoodsEntity.m
;
sourceTree
=
"<group>"
;
};
060A22321CFC55C700945BA4
/* CustomShopingSeclectButton.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
CustomShopingSeclectButton.h
;
sourceTree
=
"<group>"
;
};
060A22331CFC55C700945BA4
/* CustomShopingSeclectButton.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
CustomShopingSeclectButton.m
;
sourceTree
=
"<group>"
;
};
060D39781CE45CFE0082AECD
/* ImageCropperView.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ImageCropperView.h
;
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>"
;
};
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>"
;
};
060D397A1CE45CFE0082AECD
/* UIImage+Rotation.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"UIImage+Rotation.h"
;
sourceTree
=
"<group>"
;
};
...
@@ -499,11 +505,15 @@
...
@@ -499,11 +505,15 @@
name
=
views
;
name
=
views
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
};
};
04A5203D1CE90ADB001D4520
/* c
ontroller
*/
=
{
04A5203D1CE90ADB001D4520
/* c
ustomModel
*/
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
060A222F1CFC518E00945BA4
/* CustomTOGoodsEntity.h */
,
060A22301CFC518E00945BA4
/* CustomTOGoodsEntity.m */
,
060A22321CFC55C700945BA4
/* CustomShopingSeclectButton.h */
,
060A22331CFC55C700945BA4
/* CustomShopingSeclectButton.m */
,
);
);
name
=
c
ontroller
;
name
=
c
ustomModel
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
};
};
04A5203E1CE93604001D4520
/* customCell */
=
{
04A5203E1CE93604001D4520
/* customCell */
=
{
...
@@ -1012,7 +1022,7 @@
...
@@ -1012,7 +1022,7 @@
children
=
(
children
=
(
041636BF1CF39568008CE961
/* category */
,
041636BF1CF39568008CE961
/* category */
,
04A5203E1CE93604001D4520
/* customCell */
,
04A5203E1CE93604001D4520
/* customCell */
,
04A5203D1CE90ADB001D4520
/* c
ontroller
*/
,
04A5203D1CE90ADB001D4520
/* c
ustomModel
*/
,
060D39771CE45CFE0082AECD
/* tools */
,
060D39771CE45CFE0082AECD
/* tools */
,
0470D60E1CE292EF00647F0F
/* subView */
,
0470D60E1CE292EF00647F0F
/* subView */
,
04A14A221CE0FB8400DAD5F3
/* views */
,
04A14A221CE0FB8400DAD5F3
/* views */
,
...
@@ -1326,6 +1336,7 @@
...
@@ -1326,6 +1336,7 @@
29706D9F1CD082980003C412
/* Resources */
,
29706D9F1CD082980003C412
/* Resources */
,
81ABC0A096BEAA39EE881ABF
/* 📦 Embed Pods Frameworks */
,
81ABC0A096BEAA39EE881ABF
/* 📦 Embed Pods Frameworks */
,
35C733F7E327DAE2BD83B6C9
/* 📦 Copy Pods Resources */
,
35C733F7E327DAE2BD83B6C9
/* 📦 Copy Pods Resources */
,
C5D09BDA1C34591594D93F3A
/* Embed Pods Frameworks */
,
);
);
buildRules
=
(
buildRules
=
(
);
);
...
@@ -1449,6 +1460,21 @@
...
@@ -1449,6 +1460,21 @@
shellScript
=
"\"${SRCROOT}/Pods/Target Support Files/Pods-Lighting/Pods-Lighting-frameworks.sh\"\n"
;
shellScript
=
"\"${SRCROOT}/Pods/Target Support Files/Pods-Lighting/Pods-Lighting-frameworks.sh\"\n"
;
showEnvVarsInLog
=
0
;
showEnvVarsInLog
=
0
;
};
};
C5D09BDA1C34591594D93F3A
/* Embed Pods Frameworks */
=
{
isa
=
PBXShellScriptBuildPhase
;
buildActionMask
=
2147483647
;
files
=
(
);
inputPaths
=
(
);
name
=
"Embed Pods Frameworks"
;
outputPaths
=
(
);
runOnlyForDeploymentPostprocessing
=
0
;
shellPath
=
/bin/sh
;
shellScript
=
"\"${SRCROOT}/Pods/Target Support Files/Pods-Lighting/Pods-Lighting-frameworks.sh\"\n"
;
showEnvVarsInLog
=
0
;
};
/* End PBXShellScriptBuildPhase section */
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
...
@@ -1489,6 +1515,7 @@
...
@@ -1489,6 +1515,7 @@
2908870B1CE5A308000B7097
/* DateSelectedViewController.m in Sources */
,
2908870B1CE5A308000B7097
/* DateSelectedViewController.m in Sources */
,
299876271CD9837C00C90D0A
/* OrderTableViewCell.m in Sources */
,
299876271CD9837C00C90D0A
/* OrderTableViewCell.m in Sources */
,
2998763C1CD9983A00C90D0A
/* CommodityListTableViewCell.m in Sources */
,
2998763C1CD9983A00C90D0A
/* CommodityListTableViewCell.m in Sources */
,
060A22341CFC55C700945BA4
/* CustomShopingSeclectButton.m in Sources */
,
2962D0791CD1CBC60058829D
/* NetworkRequestClassManager.m in Sources */
,
2962D0791CD1CBC60058829D
/* NetworkRequestClassManager.m in Sources */
,
29F725FB1CE17B0D0072FE0E
/* Shoppersmanager.m in Sources */
,
29F725FB1CE17B0D0072FE0E
/* Shoppersmanager.m in Sources */
,
29F14BA91CF6B60D0005D3E5
/* QRUtil.m in Sources */
,
29F14BA91CF6B60D0005D3E5
/* QRUtil.m in Sources */
,
...
@@ -1503,6 +1530,7 @@
...
@@ -1503,6 +1530,7 @@
29CCA43C1CF7ED6100BC19DD
/* SelectedTableViewCell.m in Sources */
,
29CCA43C1CF7ED6100BC19DD
/* SelectedTableViewCell.m in Sources */
,
294CF0EC1CEDCF480055F1D8
/* PromptinformationView.m in Sources */
,
294CF0EC1CEDCF480055F1D8
/* PromptinformationView.m in Sources */
,
290887131CE5DF16000B7097
/* ShopcarModel.m in Sources */
,
290887131CE5DF16000B7097
/* ShopcarModel.m in Sources */
,
060A22311CFC518E00945BA4
/* CustomTOGoodsEntity.m in Sources */
,
04FCB1A41CF60A8F0056093B
/* DeviceDirectionManager.m in Sources */
,
04FCB1A41CF60A8F0056093B
/* DeviceDirectionManager.m in Sources */
,
29BB27681CD9D38E009A0813
/* AllpriceTableViewCell.m in Sources */
,
29BB27681CD9D38E009A0813
/* AllpriceTableViewCell.m in Sources */
,
29BB27771CD9DFBA009A0813
/* ProductLibraryViewController.m in Sources */
,
29BB27771CD9DFBA009A0813
/* ProductLibraryViewController.m in Sources */
,
...
@@ -1722,7 +1750,7 @@
...
@@ -1722,7 +1750,7 @@
);
);
PRODUCT_BUNDLE_IDENTIFIER
=
com.gomore.opple
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.gomore.opple
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PROVISIONING_PROFILE
=
"
e9bd3600-5e9c-4cd0-a0d5-b7d8b0882ca8
"
;
PROVISIONING_PROFILE
=
"
d25ba75f-c4da-4bef-b966-3a998dcbffbe
"
;
STRIP_PNG_TEXT
=
NO
;
STRIP_PNG_TEXT
=
NO
;
USER_HEADER_SEARCH_PATHS
=
"$(PODS_ROOT)/**"
;
USER_HEADER_SEARCH_PATHS
=
"$(PODS_ROOT)/**"
;
};
};
...
@@ -1778,7 +1806,7 @@
...
@@ -1778,7 +1806,7 @@
);
);
PRODUCT_BUNDLE_IDENTIFIER
=
com.gomore.opple
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.gomore.opple
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PROVISIONING_PROFILE
=
"
e9bd3600-5e9c-4cd0-a0d5-b7d8b0882ca8
"
;
PROVISIONING_PROFILE
=
"
d25ba75f-c4da-4bef-b966-3a998dcbffbe
"
;
STRIP_PNG_TEXT
=
NO
;
STRIP_PNG_TEXT
=
NO
;
USER_HEADER_SEARCH_PATHS
=
"$(PODS_ROOT)/**"
;
USER_HEADER_SEARCH_PATHS
=
"$(PODS_ROOT)/**"
;
};
};
...
...
Lighting/Podfile.lock
View file @
81a8073c
...
@@ -64,6 +64,4 @@ SPEC CHECKSUMS:
...
@@ -64,6 +64,4 @@ SPEC CHECKSUMS:
SVProgressHUD: b0830714205bea1317ea1a2ebc71e5633af334d4
SVProgressHUD: b0830714205bea1317ea1a2ebc71e5633af334d4
UMengSocial: 48b67179c492a8cf7803fbb0438b8f55432e2fc1
UMengSocial: 48b67179c492a8cf7803fbb0438b8f55432e2fc1
PODFILE CHECKSUM: ce813becb6471581d2231aa1586a015081ae7114
COCOAPODS: 0.39.0
COCOAPODS: 1.0.0
Lighting/Tools/opple_objc_json_client.h
View file @
81a8073c
...
@@ -557,12 +557,14 @@ extern NSString * const SORTDIRECTION_DESC;
...
@@ -557,12 +557,14 @@ extern NSString * const SORTDIRECTION_DESC;
*
*
*
*
*/
*/
//针对多个商品 goodsId拼接商品id ,号隔开
@property
(
nonatomic
,
copy
)
NSString
*
goodsId
;
@property
(
nonatomic
,
copy
)
NSString
*
goodsId
;
/**
/**
* 商品数量,>0表示添加, <0表示减少
* 商品数量,>0表示添加, <0表示减少
*
*
*
*
*/
*/
//针对多个商品 count拼接商品count ,号隔开
@property
(
nonatomic
,
copy
)
NSString
*
count
;
@property
(
nonatomic
,
copy
)
NSString
*
count
;
@end
/* interface SaveShoppingCartRequest */
@end
/* interface SaveShoppingCartRequest */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment