Commit 14549f5d authored by 曹云霄's avatar 曹云霄

优化部分方法名大写字母开头

parent 2ad224ab
......@@ -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)ReturnButtonClickAction:(UIButton *)sender {
- (IBAction)returnButtonClickAction:(UIButton *)sender {
SHARED_APPDELEGATE.sceneArray = nil;
SHARED_APPDELEGATE.productArray = nil;
......@@ -240,7 +246,7 @@
#pragma mark -购物袋
- (IBAction)ShoppingBagButtonClickAction:(UIButton *)sender {
- (IBAction)shoppingBagButtonClickAction:(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)ShareButtonClickAction:(UIButton *)sender {
- (IBAction)shareButtonClickAction:(UIButton *)sender {
if (!self.shareGoodsArray.count) {
[XBLoadingView showHUDViewWithText:@"没有选择需要分享的商品"];
......@@ -291,7 +363,7 @@
}
#pragma mark -拍照
- (IBAction)TakingPhotoButtonClickAction:(UIButton *)sender {
- (IBAction)takingPhotoButtonClickAction:(UIButton *)sender {
// 判断应用是否有使用相机的权限
if([BaseViewController determineCameraPermissions]){
sender.selected = YES;
......@@ -365,7 +437,7 @@
#pragma mark -全屏
- (IBAction)AmplificationButtonClickAction:(UIButton *)sender {
- (IBAction)amplificationButtonClickAction:(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)HelpButtonClickAction:(UIButton *)sender {
- (IBAction)helpButtonClickAction:(UIButton *)sender {
sender.selected = YES;
HelpController *helpView = [[HelpController alloc]init];
......@@ -425,7 +497,7 @@
/**************************功能区**************************/
#pragma mark -场景筛选
- (IBAction)SceneSelectedButtonClickAction:(UIButton *)sender {
- (IBAction)sceneSelectedButtonClickAction:(UIButton *)sender {
sender.selected = YES;
[UserDefault setBool:YES forKey:@"SCENE"];
......@@ -448,7 +520,7 @@
}
#pragma mark -产品筛选
- (IBAction)ProductSelectedButtonClickAction:(UIButton *)sender {
- (IBAction)productSelectedButtonClickAction:(UIButton *)sender {
sender.selected = YES;
[UserDefault setBool:NO forKey:@"SCENE"];
......
......@@ -28,4 +28,8 @@
*/
@property (nonatomic,copy) NSString *showImageViewAddress;
/**
自定义Tag
*/
@property (nonatomic, copy) NSString *customTag;
@end
......@@ -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">
......
File added
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