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
14549f5d
Commit
14549f5d
authored
Jul 31, 2017
by
曹云霄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化部分方法名大写字母开头
parent
2ad224ab
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
17 deletions
+93
-17
ExperienceCentreViewController.m
...eriencecentre/Controller/ExperienceCentreViewController.m
+81
-9
GoodsImageView.h
Lighting/Class/Experiencecentre/View/GoodsImageView.h
+4
-0
OppleMain.storyboard
Lighting/StoryBoards/OppleMain.storyboard
+8
-8
archive.zip
archive.zip
+0
-0
No files found.
Lighting/Class/Experiencecentre/Controller/ExperienceCentreViewController.m
View file @
14549f5d
...
...
@@ -15,15 +15,21 @@
#import "DeviceDirectionManager.h"
#import "HelpController.h"
#import "ShoppingBagViewController.h"
#import "OSSHelper.h"
#define LEFTWIDTH 100
#define RIGHTWIDTH 200
#define TOPWIDTH 300
@interface
ExperienceCentreViewController
()
<
AddImagesDelegate
,
UICollectionViewDelegate
,
UICollectionViewDataSource
,
UITableViewDelegate
,
UITableViewDataSource
,
UIGestureRecognizerDelegate
,
UIImagePickerControllerDelegate
,
UINavigationControllerDelegate
>
@interface
ExperienceCentreViewController
()
<
AddImagesDelegate
,
UICollectionViewDelegate
,
UICollectionViewDataSource
,
UITableViewDelegate
,
UITableViewDataSource
,
UIGestureRecognizerDelegate
,
UIImagePickerControllerDelegate
,
UINavigationControllerDelegate
,
ShoppingBagDelegate
>
/**
选中商品数组
*/
@property
(
nonatomic
,
strong
)
NSArray
*
selectedGoodsArray
;
@end
...
...
@@ -231,7 +237,7 @@
#pragma mark -返回
-
(
IBAction
)
R
eturnButtonClickAction
:
(
UIButton
*
)
sender
{
-
(
IBAction
)
r
eturnButtonClickAction
:
(
UIButton
*
)
sender
{
SHARED_APPDELEGATE
.
sceneArray
=
nil
;
SHARED_APPDELEGATE
.
productArray
=
nil
;
...
...
@@ -240,7 +246,7 @@
#pragma mark -购物袋
-
(
IBAction
)
S
hoppingBagButtonClickAction
:
(
UIButton
*
)
sender
{
-
(
IBAction
)
s
hoppingBagButtonClickAction
:
(
UIButton
*
)
sender
{
sender
.
selected
=
YES
;
ShoppingBagViewController
*
shoppingBag
=
[
ShoppingBagViewController
viewControllerWithStoryBoardType
:
STORYBOARD_TYPE_MAIN
];
...
...
@@ -250,12 +256,78 @@
shoppingBag
.
modalPresentationStyle
=
UIModalPresentationOverFullScreen
;
UIPopoverPresentationController
*
pop
=
shoppingBag
.
popoverPresentationController
;
pop
.
sourceView
=
shoppingBag
.
view
;
shoppingBag
.
delegate
=
self
;
shoppingBag
.
datasArray
=
self
.
shareGoodsArray
;
[
self
presentViewController
:
shoppingBag
animated
:
YES
completion
:
nil
];
}
#pragma mark - ShoppingBagDelegate
-
(
void
)
dismissController
{
self
.
shoppingbagButton
.
selected
=
NO
;
}
-
(
void
)
addToShoppingCar
:
(
NSArray
<
ShopcarModel
*>
*
)
selectGoods
finish
:
(
void
(
^
)(
NSString
*
))
completed
{
NSMutableArray
*
imageViewtags
=
[
NSMutableArray
array
];
for
(
ShopcarModel
*
model
in
selectGoods
)
{
[
imageViewtags
addObject
:
model
.
goods
.
fid
];
}
NSMutableArray
*
removeArray
=
[
NSMutableArray
array
];
for
(
id
object
in
self
.
sceneBackView
.
subviews
)
{
if
([
object
isKindOfClass
:[
GoodsImageView
class
]])
{
GoodsImageView
*
imageView
=
(
GoodsImageView
*
)
object
;
if
(
!
[
imageViewtags
containsObject
:
imageView
.
customTag
])
{
[
removeArray
addObject
:
imageView
];
}
}
}
self
.
selectedGoodsArray
=
removeArray
;
for
(
UIImageView
*
imageView
in
removeArray
)
{
[
imageView
setHidden
:
YES
];
}
UIImage
*
screenImage
=
[
self
capture
];
dispatch_async
(
dispatch_get_global_queue
(
DISPATCH_QUEUE_PRIORITY_DEFAULT
,
0
),
^
{
UIImageWriteToSavedPhotosAlbum
(
screenImage
,
self
,
@selector
(
image
:
didFinishSavingWithError
:
contextInfo
:
),
NULL
);
});
[
self
uploadScreenImageOSS
:
screenImage
finish
:
^
(
NSString
*
ossKey
)
{
completed
(
ossKey
);
}];
}
/**
上传屏幕截图到OSS
*/
-
(
void
)
uploadScreenImageOSS
:
(
UIImage
*
)
image
finish
:
(
void
(
^
)(
NSString
*
ossKey
))
completed
{
XBLoadingView
*
loadView
=
[
XBLoadingView
showHUDViewProgressLabel
:
@"图片上传中"
];
NSString
*
ossKey
=
[
OSSHelper
getOSSObjectKeyWithtype
:
@"jpg"
];
NSData
*
data
=
UIImageJPEGRepresentation
(
image
,
0
.
5
);
dispatch_async
(
dispatch_get_global_queue
(
DISPATCH_QUEUE_PRIORITY_DEFAULT
,
0
),
^
{
[
OSSHelper
uploadImageObjectWithKey
:
ossKey
data
:
data
type
:
OSSHelperOperationTypeSynchronous
progress
:^
(
int64_t
bytesSent
,
int64_t
totalBytesSent
,
int64_t
totalBytesExpectedToSend
)
{
CGFloat
totalBytesSentFloat
=
totalBytesSent
;
CGFloat
totalBytesExpectedToSendFloat
=
totalBytesExpectedToSend
;
CGFloat
progress
=
totalBytesSentFloat
/
totalBytesExpectedToSendFloat
;
loadView
.
progress
=
progress
;
}
success
:^
id
(
OSSTask
*
task
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
loadView
hide
:
YES
];
[
XBLoadingView
showHUDViewWithSuccessText
:
@"图片上传成功"
completeBlock
:
^
{
completed
(
ossKey
);
}];
});
return
nil
;
}
error
:^
(
NSError
*
error
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
loadView
hide
:
YES
];
});
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
});
}
#pragma mark -分享
-
(
IBAction
)
S
hareButtonClickAction
:
(
UIButton
*
)
sender
{
-
(
IBAction
)
s
hareButtonClickAction
:
(
UIButton
*
)
sender
{
if
(
!
self
.
shareGoodsArray
.
count
)
{
[
XBLoadingView
showHUDViewWithText
:
@"没有选择需要分享的商品"
];
...
...
@@ -291,7 +363,7 @@
}
#pragma mark -拍照
-
(
IBAction
)
T
akingPhotoButtonClickAction
:
(
UIButton
*
)
sender
{
-
(
IBAction
)
t
akingPhotoButtonClickAction
:
(
UIButton
*
)
sender
{
// 判断应用是否有使用相机的权限
if
([
BaseViewController
determineCameraPermissions
]){
sender
.
selected
=
YES
;
...
...
@@ -365,7 +437,7 @@
#pragma mark -全屏
-
(
IBAction
)
A
mplificationButtonClickAction
:
(
UIButton
*
)
sender
{
-
(
IBAction
)
a
mplificationButtonClickAction
:
(
UIButton
*
)
sender
{
if
(
!
sender
.
selected
)
{
[
UIView
animateWithDuration
:
0
.
75
delay
:
0
options
:
UIViewAnimationOptionCurveEaseOut
animations
:^
{
self
.
returnButton
.
frame
=
CGRectMake
(
self
.
returnButton
.
mj_x
-
LEFTWIDTH
,
self
.
returnButton
.
mj_y
,
self
.
returnButton
.
mj_w
,
self
.
returnButton
.
mj_h
);
...
...
@@ -398,7 +470,7 @@
}
#pragma mark -帮助
-
(
IBAction
)
H
elpButtonClickAction
:
(
UIButton
*
)
sender
{
-
(
IBAction
)
h
elpButtonClickAction
:
(
UIButton
*
)
sender
{
sender
.
selected
=
YES
;
HelpController
*
helpView
=
[[
HelpController
alloc
]
init
];
...
...
@@ -425,7 +497,7 @@
/**************************功能区**************************/
#pragma mark -场景筛选
-
(
IBAction
)
S
ceneSelectedButtonClickAction
:
(
UIButton
*
)
sender
{
-
(
IBAction
)
s
ceneSelectedButtonClickAction
:
(
UIButton
*
)
sender
{
sender
.
selected
=
YES
;
[
UserDefault
setBool
:
YES
forKey
:
@"SCENE"
];
...
...
@@ -448,7 +520,7 @@
}
#pragma mark -产品筛选
-
(
IBAction
)
P
roductSelectedButtonClickAction
:
(
UIButton
*
)
sender
{
-
(
IBAction
)
p
roductSelectedButtonClickAction
:
(
UIButton
*
)
sender
{
sender
.
selected
=
YES
;
[
UserDefault
setBool
:
NO
forKey
:
@"SCENE"
];
...
...
Lighting/Class/Experiencecentre/View/GoodsImageView.h
View file @
14549f5d
...
...
@@ -28,4 +28,8 @@
*/
@property
(
nonatomic
,
copy
)
NSString
*
showImageViewAddress
;
/**
自定义Tag
*/
@property
(
nonatomic
,
copy
)
NSString
*
customTag
;
@end
Lighting/StoryBoards/OppleMain.storyboard
View file @
14549f5d
...
...
@@ -6251,7 +6251,7 @@
</constraints>
<state
key=
"normal"
backgroundImage=
"1"
/>
<connections>
<action
selector=
"
ReturnButtonClickAction:"
destination=
"Gqn-uq-cA1"
eventType=
"touchUpInside"
id=
"iBL-Zc-enW
"
/>
<action
selector=
"
returnButtonClickAction:"
destination=
"Gqn-uq-cA1"
eventType=
"touchUpInside"
id=
"2f8-dd-qjA
"
/>
</connections>
</button>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"Owr-Ny-CHc"
>
...
...
@@ -6263,7 +6263,7 @@
<state
key=
"normal"
backgroundImage=
"gouwuche"
/>
<state
key=
"selected"
backgroundImage=
"selectshoping"
/>
<connections>
<action
selector=
"
ShoppingBagButtonClickAction:"
destination=
"Gqn-uq-cA1"
eventType=
"touchUpInside"
id=
"4on-rf-6wU
"
/>
<action
selector=
"
shoppingBagButtonClickAction:"
destination=
"Gqn-uq-cA1"
eventType=
"touchUpInside"
id=
"yVe-Oj-X4z
"
/>
</connections>
</button>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"RLx-QE-anb"
>
...
...
@@ -6275,7 +6275,7 @@
<state
key=
"normal"
backgroundImage=
"fenxiang"
/>
<state
key=
"selected"
backgroundImage=
"selectShare"
/>
<connections>
<action
selector=
"
ShareButtonClickAction:"
destination=
"Gqn-uq-cA1"
eventType=
"touchUpInside"
id=
"SkX-Ud-eH9
"
/>
<action
selector=
"
shareButtonClickAction:"
destination=
"Gqn-uq-cA1"
eventType=
"touchUpInside"
id=
"Emb-i1-eg1
"
/>
</connections>
</button>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"J0C-9n-Nc1"
>
...
...
@@ -6287,7 +6287,7 @@
<state
key=
"normal"
backgroundImage=
"customchangjing"
/>
<state
key=
"selected"
backgroundImage=
"selectCamer"
/>
<connections>
<action
selector=
"
TakingPhotoButtonClickAction:"
destination=
"Gqn-uq-cA1"
eventType=
"touchUpInside"
id=
"a1e-Ai-Itx
"
/>
<action
selector=
"
takingPhotoButtonClickAction:"
destination=
"Gqn-uq-cA1"
eventType=
"touchUpInside"
id=
"Fnv-mX-C3l
"
/>
</connections>
</button>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"Rdf-QC-ILr"
>
...
...
@@ -6299,7 +6299,7 @@
<state
key=
"normal"
backgroundImage=
"quanping"
/>
<state
key=
"selected"
backgroundImage=
"xiaoping"
/>
<connections>
<action
selector=
"
AmplificationButtonClickAction:"
destination=
"Gqn-uq-cA1"
eventType=
"touchUpInside"
id=
"NSd-sb-tbj
"
/>
<action
selector=
"
amplificationButtonClickAction:"
destination=
"Gqn-uq-cA1"
eventType=
"touchUpInside"
id=
"0Cz-8j-SWJ
"
/>
</connections>
</button>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"yLQ-kh-sZt"
>
...
...
@@ -6311,7 +6311,7 @@
<state
key=
"normal"
backgroundImage=
"bangzhu"
/>
<state
key=
"selected"
backgroundImage=
"selectHelp"
/>
<connections>
<action
selector=
"
HelpButtonClickAction:"
destination=
"Gqn-uq-cA1"
eventType=
"touchUpInside"
id=
"vNb-YQ-vFg
"
/>
<action
selector=
"
helpButtonClickAction:"
destination=
"Gqn-uq-cA1"
eventType=
"touchUpInside"
id=
"3f9-eD-1PT
"
/>
</connections>
</button>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"zpl-1T-9tQ"
>
...
...
@@ -6338,7 +6338,7 @@
<state
key=
"normal"
backgroundImage=
"场景2"
/>
<state
key=
"selected"
backgroundImage=
"场景1"
/>
<connections>
<action
selector=
"
SceneSelectedButtonClickAction:"
destination=
"Gqn-uq-cA1"
eventType=
"touchUpInside"
id=
"wnw-wT-qrA
"
/>
<action
selector=
"
sceneSelectedButtonClickAction:"
destination=
"Gqn-uq-cA1"
eventType=
"touchUpInside"
id=
"oH3-SQ-zJf
"
/>
</connections>
</button>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"Liv-2f-f1g"
>
...
...
@@ -6350,7 +6350,7 @@
<state
key=
"normal"
backgroundImage=
"产品2"
/>
<state
key=
"selected"
backgroundImage=
"产品1"
/>
<connections>
<action
selector=
"
ProductSelectedButtonClickAction:"
destination=
"Gqn-uq-cA1"
eventType=
"touchUpInside"
id=
"hpB-yH-WYT
"
/>
<action
selector=
"
productSelectedButtonClickAction:"
destination=
"Gqn-uq-cA1"
eventType=
"touchUpInside"
id=
"WgA-Gz-PoP
"
/>
</connections>
</button>
<collectionView
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"scaleToFill"
dataMode=
"prototypes"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"rtu-sJ-bqU"
>
...
...
archive.zip
0 → 100644
View file @
14549f5d
File added
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