Commit 4da09d93 authored by 曹云霄's avatar 曹云霄

修改项说明:修改促销机制,统一选择

parent 4504075d
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
for (int j=0; j<order.eCards.count; j++) { for (int j=0; j<order.eCards.count; j++) {
TOJingdongEcardEntity *ecard = order.eCards[j]; TOJingdongEcardEntity *ecard = order.eCards[j];
if ([eCardNumber isEqualToString:ecard.cardNumber]) { if ([eCardNumber isEqualToString:ecard.cardNumber]) {
ecard.state = @"used"; ecard.state = USED;
[self.beenUseCardCollectionView reloadItemsAtIndexPaths:@[[NSIndexPath indexPathForItem:j inSection:i]]]; [self.beenUseCardCollectionView reloadItemsAtIndexPaths:@[[NSIndexPath indexPathForItem:j inSection:i]]];
} }
} }
......
//
// CustomPromotionModel.h
// Lighting
//
// Created by 曹云霄 on 2016/11/15.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <JSONModel/JSONModel.h>
#import <Foundation/Foundation.h>
@interface CustomPromotionModel : JSONModel
// 奖品描述
@property (nonatomic,copy) NSString *descriptionString;
// 是否选中
@property (nonatomic,assign) BOOL isSelected;
// 优先级
@property (nonatomic,assign) NSInteger priority;
// 冲突列表
@property (nonatomic,strong) NSArray *conflicts;
// 促销对象
@property (nonatomic, copy) NSString *body;
// 类型
@property (nonatomic, copy) NSString *type;
- (instancetype)initCustomPromotionModel:(JSONModel *)model;
@end
//
// CustomPromotionModel.m
// Lighting
//
// Created by 曹云霄 on 2016/11/15.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "CustomPromotionModel.h"
#import "PromotionLuckyDrawModel.h"
#import "PromotionalGoodsModel.h"
#import "PromotionalDeductionModel.h"
#import "PromotionWeChatCardModel.h"
@implementation CustomPromotionModel
- (instancetype)initCustomPromotionModel:(JSONModel *)model
{
if (self = [super init]) {
//微信卡劵
if ([model isMemberOfClass:[PromotionWeChatCardModel class]]) {
PromotionWeChatCardModel *weChatModel = (PromotionWeChatCardModel *)model;
self.descriptionString = weChatModel.descriptionString;
self.type = weChatModel.type;
self.body = weChatModel.body;
self.conflicts = weChatModel.conflicts;
self.priority = weChatModel.priority;
}else if ([model isMemberOfClass:[PromotionalDeductionModel class]]) {
//抵扣
PromotionalDeductionModel *deductionModel = (PromotionalDeductionModel *)model;
self.descriptionString = deductionModel.descriptionString;
self.type = deductionModel.type;
self.body = deductionModel.body;
self.conflicts = deductionModel.conflicts;
self.priority = deductionModel.priority;
}else if ([model isMemberOfClass:[PromotionLuckyDrawModel class]]) {
//抽奖
PromotionLuckyDrawModel *drawModel = (PromotionLuckyDrawModel *)model;
self.descriptionString = drawModel.descriptionString;
self.type = drawModel.type;
self.body = drawModel.body;
self.conflicts = drawModel.conflicts;
self.priority = drawModel.priority;
}else if ([model isMemberOfClass:[PromotionalGoodsModel class]]) {
//送商品
PromotionalGoodsModel *goodsModel = (PromotionalGoodsModel *)model;
self.descriptionString = goodsModel.descriptionString;
self.type = goodsModel.type;
self.body = goodsModel.body;
self.conflicts = goodsModel.conflicts;
self.priority = goodsModel.priority;
}
}
return self;
}
@end
...@@ -68,11 +68,29 @@ ...@@ -68,11 +68,29 @@
return _model; return _model;
} }
#pragma mark -渲染完成
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
self.navigationController.fd_fullscreenPopGestureRecognizer.enabled = NO;
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
}
}
#pragma mark -视图即将消失
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
self.navigationController.fd_fullscreenPopGestureRecognizer.enabled = YES;
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = YES;
}
}
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
// Do any additional setup after loading the view.
[self uiConfigAction]; [self uiConfigAction];
} }
...@@ -96,10 +114,10 @@ ...@@ -96,10 +114,10 @@
//经销商代码 //经销商代码
self.model.resellerCodeEquals = [[Shoppersmanager manager].Shoppers.employee.currentDepart orgCode]; self.model.resellerCodeEquals = [[Shoppersmanager manager].Shoppers.employee.currentDepart orgCode];
//下拉刷新 //下拉刷新
__weak typeof(self) weakSelf = self; WS(weakSelf);
MjRefreshHeaderCustom *headerRefresh = [MjRefreshHeaderCustom headerWithRefreshingBlock:^{ MjRefreshHeaderCustom *headerRefresh = [MjRefreshHeaderCustom headerWithRefreshingBlock:^{
self.indexPage = 1; self.indexPage = ONE;
DataPage *page = [[DataPage alloc]init]; DataPage *page = [[DataPage alloc]init];
page.page = weakSelf.indexPage; page.page = weakSelf.indexPage;
page.rows = KROWS; page.rows = KROWS;
......
...@@ -8,6 +8,20 @@ ...@@ -8,6 +8,20 @@
#import "BaseViewController.h" #import "BaseViewController.h"
/**
抽奖状态
- ALLDRAW: 所有状态
- NOTDRAW: 未抽奖
- USEDDRAW: 已抽奖
*/
typedef NS_ENUM(NSInteger, DRAWSTATE) {
ALLDRAW = 0,
NOTDRAW,
USEDDRAW
};
@interface LuckyDrawDetailsViewController : BaseViewController @interface LuckyDrawDetailsViewController : BaseViewController
......
...@@ -44,22 +44,21 @@ ...@@ -44,22 +44,21 @@
page.order = SORTDIRECTION_DESC; page.order = SORTDIRECTION_DESC;
_drawModel.page = page; _drawModel.page = page;
switch (self.drawValue) { switch (self.drawValue) {
case 0: case ALLDRAW:
{ {
_drawModel.stateEquals = nil; _drawModel.stateEquals = nil;
} }
break; break;
case 1: case NOTDRAW:
{ {
_drawModel.stateEquals = INITIAL; _drawModel.stateEquals = INITIAL;
} }
break; break;
case 2: case USEDDRAW:
{ {
_drawModel.stateEquals = ACCOMPLISHED; _drawModel.stateEquals = ACCOMPLISHED;
} }
break; break;
default: default:
break; break;
} }
...@@ -129,7 +128,6 @@ ...@@ -129,7 +128,6 @@
{ {
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
NSLog(@"%@",[self.drawModel toDictionary]);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(LOTTERYED) WithCallClass:weakSelf WithRequestType:ZERO WithParameter:self.drawModel WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(LOTTERYED) WithCallClass:weakSelf WithRequestType:ZERO WithParameter:self.drawModel WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
......
This diff is collapsed.
//
// PromotionChooseNavigationController.h
// Lighting
//
// Created by 曹云霄 on 2016/11/14.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface PromotionChooseNavigationController : UINavigationController
@end
//
// PromotionChooseNavigationController.m
// Lighting
//
// Created by 曹云霄 on 2016/11/14.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "PromotionChooseNavigationController.h"
@interface PromotionChooseNavigationController ()
@end
@implementation PromotionChooseNavigationController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.navigationBar.translucent = NO;
}
- (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
//
// PromotionChooseTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 2016/11/14.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "CustomPromotionModel.h"
@interface PromotionChooseTableViewCell : UITableViewCell
/**
促销模型
*/
@property (nonatomic,strong) CustomPromotionModel *promotionModel;
@end
//
// PromotionChooseTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 2016/11/14.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "PromotionChooseTableViewCell.h"
#import "PromotionWeChatCardModel.h"
#import "PromotionalGoodsModel.h"
#import "PromotionalDeductionModel.h"
#import "PromotionLuckyDrawModel.h"
@implementation PromotionChooseTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
self.textLabel.font = [UIFont systemFontOfSize:12];
}
- (void)setPromotionModel:(CustomPromotionModel *)promotionModel
{
self.textLabel.text = promotionModel.descriptionString;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
}
@end
...@@ -7,7 +7,32 @@ ...@@ -7,7 +7,32 @@
// //
#import "BaseViewController.h" #import "BaseViewController.h"
#import "CustomPromotionModel.h"
/**
确认选择促销条件后
*/
@protocol confirmPromotionDelegate <NSObject>
@optional
- (void)confirmChoosePromotion:(NSArray<CustomPromotionModel *>*)promotionArray;
@end
@interface PromotionChooseViewController : BaseViewController @interface PromotionChooseViewController : BaseViewController
@property (nonatomic,weak) id<confirmPromotionDelegate>promotionDelegate;
/**
选择促销
*/
@property (weak, nonatomic) IBOutlet UITableView *promotionChooseTableView;
/**
消费者促销列表
*/
@property (nonatomic,copy) NSArray <JSONModel*>*promotionDatasArray;
@end @end
...@@ -7,31 +7,131 @@ ...@@ -7,31 +7,131 @@
// //
#import "PromotionChooseViewController.h" #import "PromotionChooseViewController.h"
#import "PromotionChooseTableViewCell.h"
#import "PromotionWeChatCardModel.h"
#import "PromotionalGoodsModel.h"
#import "PromotionalDeductionModel.h"
#import "PromotionLuckyDrawModel.h"
@interface PromotionChooseViewController () @interface PromotionChooseViewController ()<UITableViewDelegate,UITableViewDataSource>
/**
自定义促销列表
*/
@property (nonatomic,strong) NSMutableArray *customPromotionDatas;
@end @end
@implementation PromotionChooseViewController @implementation PromotionChooseViewController
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
// Do any additional setup after loading the view.
[self setUpTableView];
} }
- (void)didReceiveMemoryWarning { #pragma mark - 数据源
[super didReceiveMemoryWarning]; - (void)setPromotionDatasArray:(NSArray<JSONModel *> *)promotionDatasArray
// Dispose of any resources that can be recreated. {
_promotionDatasArray = promotionDatasArray;
NSMutableArray *promotionArray = [NSMutableArray array];
[_promotionDatasArray enumerateObjectsUsingBlock:^(JSONModel * _Nonnull model, NSUInteger index, BOOL * _Nonnull stop) {
CustomPromotionModel *promotionModel = [[CustomPromotionModel alloc]initCustomPromotionModel:model];
[promotionArray addObject:promotionModel];
}];
//促销列表按降序排列
self.customPromotionDatas = [NSMutableArray arrayWithArray:[promotionArray sortedArrayUsingComparator:^NSComparisonResult(CustomPromotionModel *obj1, CustomPromotionModel *obj2) {
if (obj1.priority < obj2.priority) {
return NSOrderedAscending;
}
if (obj1.priority < obj2.priority) {
return NSOrderedDescending;
}
return NSOrderedSame;
}]];
[self calculatedPromotionConflicts:0];
}
#pragma mark - 选择促销后计算是否存在冲突
- (void)calculatedPromotionConflicts:(NSInteger)cellIndex
{
WS(weakSelf);
//默认选中最高级别促销及衍生促销
CustomPromotionModel *promotionModel = self.customPromotionDatas[cellIndex];
if (promotionModel.isSelected) {
return;
}else {
for (CustomPromotionModel *model in self.customPromotionDatas) {
model.isSelected = NO;
}
promotionModel.isSelected = YES;
}
[self.customPromotionDatas enumerateObjectsUsingBlock:^(CustomPromotionModel *model1, NSUInteger index, BOOL * _Nonnull stop) {
if (![promotionModel.conflicts containsObject:model1.type] && ![model1.conflicts containsObject:promotionModel.type]) {
for (int i=0;i<weakSelf.customPromotionDatas.count;i++) {
CustomPromotionModel *model2 = weakSelf.customPromotionDatas[i];
if (![model2.conflicts containsObject:model1.type] && ![model1.conflicts containsObject:model2.type] && ![model2 isEqual:promotionModel]) {
model1.isSelected = YES;
}
}
}else {
model1.isSelected = NO;
}
}];
[self.promotionChooseTableView reloadData];
}
#pragma mark - UITableview
- (void)setUpTableView
{
self.promotionChooseTableView.tableFooterView = [UIView new];
}
#pragma mark - <UITableViewDelegate,UITableViewDataSource>
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
PromotionChooseTableViewCell *chooseCell = [tableView dequeueReusableCellWithIdentifier:@"PromotionChooseTableViewCell" forIndexPath:indexPath];
CustomPromotionModel *model = self.customPromotionDatas[indexPath.row];
chooseCell.promotionModel = model;
chooseCell.accessoryType = model.isSelected?UITableViewCellAccessoryCheckmark:UITableViewCellAccessoryNone;
chooseCell.selectionStyle = UITableViewCellSelectionStyleNone;
return chooseCell;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return self.customPromotionDatas.count;
} }
/* - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
#pragma mark - Navigation {
[self calculatedPromotionConflicts:indexPath.row];
}
#pragma mark - 退出促销条件选择
- (IBAction)dismissPromotionChooseNavigation:(UIBarButtonItem *)sender {
[self dismissViewControllerAnimated:YES completion:nil];
}
// In a storyboard-based application, you will often want to do a little preparation before navigation #pragma mark - 确认促销条件选择
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - (IBAction)confirmPromotionChoose:(UIBarButtonItem *)sender {
// Get the new view controller using [segue destinationViewController]. [self dismissViewControllerAnimated:YES completion:nil];
// Pass the selected object to the new view controller. if ([self.promotionDelegate respondsToSelector:@selector(confirmChoosePromotion:)]) {
NSMutableArray *chooseArray = [NSMutableArray array];
for (CustomPromotionModel *model in self.customPromotionDatas) {
if (model.isSelected) {
[chooseArray addObject:model];
}
}
[self.promotionDelegate confirmChoosePromotion:chooseArray];
}
} }
*/
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
@end @end
...@@ -10,4 +10,15 @@ ...@@ -10,4 +10,15 @@
@implementation PromotionJDECardModel @implementation PromotionJDECardModel
+ (BOOL)propertyIsOptional:(NSString *)propertyName
{
return YES;
}
+ (JSONKeyMapper *)keyMapper
{
return [[JSONKeyMapper alloc]initWithDictionary:@{@"description":@"descriptionString"}];
}
@end @end
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
// 冲突列表 // 冲突列表
@property (nonatomic,strong) NSArray *conflicts; @property (nonatomic,strong) NSArray *conflicts;
// 是否选中
@property (nonatomic,assign) BOOL isSelected;
@end @end
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
//** 描述 */ //** 描述 */
@property (nonatomic, copy) NSString *descriptionString; @property (nonatomic, copy) NSString *descriptionString;
//** 是否选中 */ // 是否选中
@property (nonatomic,assign) BOOL isSelected; @property (nonatomic,assign) BOOL isSelected;
// 优先级 // 优先级
......
...@@ -10,4 +10,14 @@ ...@@ -10,4 +10,14 @@
@implementation PromotionWeChatCardModel @implementation PromotionWeChatCardModel
+ (BOOL)propertyIsOptional:(NSString *)propertyName
{
return YES;
}
+ (JSONKeyMapper *)keyMapper
{
return [[JSONKeyMapper alloc]initWithDictionary:@{@"description":@"descriptionString"}];
}
@end @end
...@@ -16,4 +16,10 @@ ...@@ -16,4 +16,10 @@
*/ */
@property (weak, nonatomic) IBOutlet UILabel *promotionalTitleLabel; @property (weak, nonatomic) IBOutlet UILabel *promotionalTitleLabel;
/**
促销信息
*/
@property (nonatomic,copy) JSONModel *promotionModel;
@end @end
...@@ -7,6 +7,10 @@ ...@@ -7,6 +7,10 @@
// //
#import "PromotionalTableViewCell.h" #import "PromotionalTableViewCell.h"
#import "PromotionLuckyDrawModel.h"
#import "PromotionalGoodsModel.h"
#import "PromotionalDeductionModel.h"
#import "PromotionWeChatCardModel.h"
@implementation PromotionalTableViewCell @implementation PromotionalTableViewCell
...@@ -15,10 +19,31 @@ ...@@ -15,10 +19,31 @@
// Initialization code // Initialization code
} }
- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - (void)setPromotionModel:(JSONModel *)promotionModel
[super setSelected:selected animated:animated]; {
_promotionModel = promotionModel;
// Configure the view for the selected state //微信卡劵
if ([promotionModel isMemberOfClass:[PromotionWeChatCardModel class]]) {
PromotionWeChatCardModel *weChatModel = (PromotionWeChatCardModel *)promotionModel;
self.promotionalTitleLabel.text = [NSString stringWithFormat:@"使用微信卡劵: %@",weChatModel.descriptionString];
}else if ([promotionModel isMemberOfClass:[PromotionalDeductionModel class]]) {
//抵扣
PromotionalDeductionModel *deductionModel = (PromotionalDeductionModel *)promotionModel;
self.promotionalTitleLabel.text = [NSString stringWithFormat:@"抵扣: %@",deductionModel.descriptionString];
}else if ([promotionModel isMemberOfClass:[PromotionLuckyDrawModel class]]) {
//抽奖
PromotionLuckyDrawModel *drawModel = (PromotionLuckyDrawModel *)promotionModel;
self.promotionalTitleLabel.text = [NSString stringWithFormat:@"转盘抽奖: %@",drawModel.descriptionString];
}else if ([promotionModel isMemberOfClass:[PromotionalGoodsModel class]]) {
//送商品
PromotionalGoodsModel *goodsModel = (PromotionalGoodsModel *)promotionModel;
self.promotionalTitleLabel.text = [NSString stringWithFormat:@"赠送商品: %@",goodsModel.descriptionString];
}
self.accessoryType = UITableViewCellAccessoryCheckmark;
} }
@end @end
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
//下拉刷新 //下拉刷新
MjRefreshHeaderCustom *headerRefresh = [MjRefreshHeaderCustom headerWithRefreshingBlock:^{ MjRefreshHeaderCustom *headerRefresh = [MjRefreshHeaderCustom headerWithRefreshingBlock:^{
//默认数据 //默认数据
self.indexPage = 1; self.indexPage = ONE;
DataPage *page = [[DataPage alloc]init]; DataPage *page = [[DataPage alloc]init];
page.page = self.indexPage; page.page = self.indexPage;
page.rows = KROWS; page.rows = KROWS;
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
- (void)getdatasAction - (void)getdatasAction
{ {
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(SCENESCREENING) WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(SCENESCREENING) WithCallClass:weakSelf WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
{ {
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(SCENELIST) WithCallClass:weakSelf WithRequestType:0 WithParameter:condition WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(SCENELIST) WithCallClass:weakSelf WithRequestType:ZERO WithParameter:condition WithReturnValueBlock:^(id returnValue) {
weakSelf.seceneLibararyCollectionView.emptyDataSetSource = weakSelf; weakSelf.seceneLibararyCollectionView.emptyDataSetSource = weakSelf;
weakSelf.seceneLibararyCollectionView.emptyDataSetDelegate = weakSelf; weakSelf.seceneLibararyCollectionView.emptyDataSetDelegate = weakSelf;
...@@ -252,7 +252,6 @@ ...@@ -252,7 +252,6 @@
#pragma mark -筛选风格 #pragma mark -筛选风格
- (void)screeningStyleButtonClick:(UIButton *)sender { - (void)screeningStyleButtonClick:(UIButton *)sender {
NSMutableArray *styleArray = [NSMutableArray arrayWithArray:self.filter.styles]; NSMutableArray *styleArray = [NSMutableArray arrayWithArray:self.filter.styles];
DataDict *style = [[DataDict alloc]init]; DataDict *style = [[DataDict alloc]init];
style.typeName = @"全部"; style.typeName = @"全部";
......
...@@ -20,14 +20,14 @@ ...@@ -20,14 +20,14 @@
@property (nonatomic,strong) NSArray *goodsArray; @property (nonatomic,strong) NSArray *goodsArray;
/** /**
* 促销信息(赠送商品、抵扣) * 促销信息
*/ */
@property (nonatomic,strong) NSArray *promotionalArray; @property (nonatomic,strong) NSArray *promotionalArray;
/** ///**
* 促销信息(京东E卡、抽奖) // * 促销信息(京东E卡、抽奖)
*/ // */
@property (nonatomic,strong) NSArray *luckyDrawAndJDECardArray; //@property (nonatomic,strong) NSArray *luckyDrawAndJDECardArray;
/** /**
* 商品总数量 * 商品总数量
...@@ -74,56 +74,46 @@ ...@@ -74,56 +74,46 @@
*/ */
@property (weak, nonatomic) IBOutlet UIButton *ISinvoiceButton; @property (weak, nonatomic) IBOutlet UIButton *ISinvoiceButton;
/** /**
* 发票类型 * 发票类型
*/ */
@property (weak, nonatomic) IBOutlet UIButton *invoiceType; @property (weak, nonatomic) IBOutlet UIButton *invoiceType;
/** /**
* 发票抬头 * 发票抬头
*/ */
@property (weak, nonatomic) IBOutlet UITextField *invoiceHeader; @property (weak, nonatomic) IBOutlet UITextField *invoiceHeader;
/** /**
* 发票抬头背景 * 发票抬头背景
*/ */
@property (weak, nonatomic) IBOutlet UIView *invoiceBackView; @property (weak, nonatomic) IBOutlet UIView *invoiceBackView;
/** /**
* 取消 * 取消
*/ */
@property (weak, nonatomic) IBOutlet UIButton *cancelButton; @property (weak, nonatomic) IBOutlet UIButton *cancelButton;
/** /**
* 确认 * 确认
*/ */
@property (weak, nonatomic) IBOutlet UIButton *sureButton; @property (weak, nonatomic) IBOutlet UIButton *sureButton;
/** /**
* 订单编号 * 订单编号
*/ */
@property (nonatomic,copy) NSString *orderCode; @property (nonatomic,copy) NSString *orderCode;
/** /**
* 京东E卡总额度 * 京东E卡总额度
*/ */
@property (nonatomic,assign) NSInteger jdCardDenomation; @property (nonatomic,assign) NSInteger jdCardDenomation;
/** /**
* 支付成功回调 * 支付成功回调
*/ */
@property (nonatomic,copy) void(^PaySuccessReturnBlock)(); @property (nonatomic,copy) void(^PaySuccessReturnBlock)();
/** /**
* 背景Scrollview * 背景Scrollview
*/ */
......
...@@ -342,7 +342,7 @@ ...@@ -342,7 +342,7 @@
order.promotionMoney = @(promotionMoney); order.promotionMoney = @(promotionMoney);
// 查询是否有京东E卡促销 // 查询是否有京东E卡促销
NSInteger totalNumber = 0; NSInteger totalNumber = 0;
for (id object in self.luckyDrawAndJDECardArray) { for (id object in self.promotionalArray) {
if ([object isKindOfClass:[PromotionJDECardModel class]]) { if ([object isKindOfClass:[PromotionJDECardModel class]]) {
PromotionJDECardModel *model = (PromotionJDECardModel *)object; PromotionJDECardModel *model = (PromotionJDECardModel *)object;
if ([model.type isEqualToString:JDECardAction] && [model.body isEqualToString:GUIDE]) { if ([model.type isEqualToString:JDECardAction] && [model.body isEqualToString:GUIDE]) {
...@@ -352,7 +352,7 @@ ...@@ -352,7 +352,7 @@
} }
order.jdCardDenomation = totalNumber; order.jdCardDenomation = totalNumber;
// 查询是否有导购抽奖机会 // 查询是否有导购抽奖机会
for (id object in self.luckyDrawAndJDECardArray) { for (id object in self.promotionalArray) {
if ([object isKindOfClass:[PromotionLuckyDrawModel class]]) { if ([object isKindOfClass:[PromotionLuckyDrawModel class]]) {
PromotionLuckyDrawModel *model = (PromotionLuckyDrawModel *)object; PromotionLuckyDrawModel *model = (PromotionLuckyDrawModel *)object;
if ([model.body isEqualToString:GUIDE]) { if ([model.body isEqualToString:GUIDE]) {
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#import "QRViewController.h" #import "QRViewController.h"
#import "ExperienceCentreViewController.h" #import "ExperienceCentreViewController.h"
#import "RebateViewController.h" #import "RebateViewController.h"
#import <AVFoundation/AVFoundation.h>
@interface CustomTabbarController ()<TabbarButtonClickdelegate,ChangpasswordDelegate,CancelButtondelegate,UITextFieldDelegate> @interface CustomTabbarController ()<TabbarButtonClickdelegate,ChangpasswordDelegate,CancelButtondelegate,UITextFieldDelegate>
...@@ -252,22 +251,16 @@ ...@@ -252,22 +251,16 @@
- (void)QrcodeButtonClick - (void)QrcodeButtonClick
{ {
WS(weakSelf); WS(weakSelf);
//判断权限 // 判断应用是否有使用相机的权限
AVAuthorizationStatus status = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]; if(![BaseViewController determineCameraPermissions]){
if(status !=AVAuthorizationStatusAuthorized) {
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"提示" message:@"请在iPad的“设置-隐私-相机”选项中,允许欧立方访问你的相机" preferredStyle:UIAlertControllerStyleAlert]; UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"提示" message:@"请在iPad的“设置-隐私-相机”选项中,允许欧立方访问你的相机" preferredStyle:UIAlertControllerStyleAlert];
[alertVC addAction:[UIAlertAction actionWithTitle:@"去设置" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
NSURL * url = [NSURL URLWithString:@"prefs:root=com.gomore.opple"];
dispatch_after(0.2, dispatch_get_main_queue(), ^{
[[UIApplication sharedApplication]openURL:url];
});
}]];
[alertVC addAction:[UIAlertAction actionWithTitle:@"知道了" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { [alertVC addAction:[UIAlertAction actionWithTitle:@"知道了" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
[weakSelf dismissViewControllerAnimated:YES completion:nil]; [[UIApplication sharedApplication]openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
}]]; }]];
[self presentViewController:alertVC animated:YES completion:nil]; [self presentViewController:alertVC animated:YES completion:nil];
}else { }else {
QRViewController *qrVC = [[QRViewController alloc] initWithScanCompleteHandler:^(NSString *url) { QRViewController *qrVC = [[QRViewController alloc] initWithScanCompleteHandler:^(NSString *url) {
[weakSelf dismissViewControllerAnimated:YES completion:^{ [weakSelf dismissViewControllerAnimated:YES completion:^{
......
...@@ -154,11 +154,14 @@ ...@@ -154,11 +154,14 @@
29D0DCE11DD9B04A00729692 /* PromotionChooseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D0DCE01DD9B04A00729692 /* PromotionChooseViewController.m */; }; 29D0DCE11DD9B04A00729692 /* PromotionChooseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D0DCE01DD9B04A00729692 /* PromotionChooseViewController.m */; };
29D0DCE41DD9B78500729692 /* PromotionJDECardModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D0DCE31DD9B78500729692 /* PromotionJDECardModel.m */; }; 29D0DCE41DD9B78500729692 /* PromotionJDECardModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D0DCE31DD9B78500729692 /* PromotionJDECardModel.m */; };
29D0DCEA1DD9B80700729692 /* PromotionWeChatCardModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D0DCE91DD9B80700729692 /* PromotionWeChatCardModel.m */; }; 29D0DCEA1DD9B80700729692 /* PromotionWeChatCardModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D0DCE91DD9B80700729692 /* PromotionWeChatCardModel.m */; };
29D0DCED1DD9C59900729692 /* PromotionChooseTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D0DCEC1DD9C59900729692 /* PromotionChooseTableViewCell.m */; };
29D0DCF01DD9CABB00729692 /* PromotionChooseNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D0DCEF1DD9CABB00729692 /* PromotionChooseNavigationController.m */; };
29D260F51CEEAE2800A9787D /* FullScreenViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D260F41CEEAE2800A9787D /* FullScreenViewController.m */; }; 29D260F51CEEAE2800A9787D /* FullScreenViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D260F41CEEAE2800A9787D /* FullScreenViewController.m */; };
29D260F81CEEAF2D00A9787D /* FullScreenViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D260F71CEEAF2D00A9787D /* FullScreenViewCell.m */; }; 29D260F81CEEAF2D00A9787D /* FullScreenViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D260F71CEEAF2D00A9787D /* FullScreenViewCell.m */; };
29D260FB1CEECDFF00A9787D /* goodsDetailsTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D260FA1CEECDFF00A9787D /* goodsDetailsTableViewCell.m */; }; 29D260FB1CEECDFF00A9787D /* goodsDetailsTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D260FA1CEECDFF00A9787D /* goodsDetailsTableViewCell.m */; };
29D260FD1CEED53400A9787D /* goodsDetailsTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29D260FC1CEED53400A9787D /* goodsDetailsTableViewCell.xib */; }; 29D260FD1CEED53400A9787D /* goodsDetailsTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29D260FC1CEED53400A9787D /* goodsDetailsTableViewCell.xib */; };
29D261001CEEF16D00A9787D /* MjRefreshHeaderCustom.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D260FF1CEEF16D00A9787D /* MjRefreshHeaderCustom.m */; }; 29D261001CEEF16D00A9787D /* MjRefreshHeaderCustom.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D260FF1CEEF16D00A9787D /* MjRefreshHeaderCustom.m */; };
29D39E4E1DDAAD2B0009FF89 /* CustomPromotionModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D39E4D1DDAAD2B0009FF89 /* CustomPromotionModel.m */; };
29D991DF1DCAE5B700840776 /* PromotionLuckyDrawModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D991DE1DCAE5B700840776 /* PromotionLuckyDrawModel.m */; }; 29D991DF1DCAE5B700840776 /* PromotionLuckyDrawModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D991DE1DCAE5B700840776 /* PromotionLuckyDrawModel.m */; };
29E28CE81CE0B91B00812A55 /* HENLENSONG.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E28CE71CE0B91B00812A55 /* HENLENSONG.m */; }; 29E28CE81CE0B91B00812A55 /* HENLENSONG.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E28CE71CE0B91B00812A55 /* HENLENSONG.m */; };
29E2D3201DB8737000443170 /* CardViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E2D31F1DB8737000443170 /* CardViewController.m */; }; 29E2D3201DB8737000443170 /* CardViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E2D31F1DB8737000443170 /* CardViewController.m */; };
...@@ -474,6 +477,10 @@ ...@@ -474,6 +477,10 @@
29D0DCE31DD9B78500729692 /* PromotionJDECardModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PromotionJDECardModel.m; sourceTree = "<group>"; }; 29D0DCE31DD9B78500729692 /* PromotionJDECardModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PromotionJDECardModel.m; sourceTree = "<group>"; };
29D0DCE81DD9B80700729692 /* PromotionWeChatCardModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PromotionWeChatCardModel.h; sourceTree = "<group>"; }; 29D0DCE81DD9B80700729692 /* PromotionWeChatCardModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PromotionWeChatCardModel.h; sourceTree = "<group>"; };
29D0DCE91DD9B80700729692 /* PromotionWeChatCardModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PromotionWeChatCardModel.m; sourceTree = "<group>"; }; 29D0DCE91DD9B80700729692 /* PromotionWeChatCardModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PromotionWeChatCardModel.m; sourceTree = "<group>"; };
29D0DCEB1DD9C59900729692 /* PromotionChooseTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PromotionChooseTableViewCell.h; sourceTree = "<group>"; };
29D0DCEC1DD9C59900729692 /* PromotionChooseTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PromotionChooseTableViewCell.m; sourceTree = "<group>"; };
29D0DCEE1DD9CABB00729692 /* PromotionChooseNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PromotionChooseNavigationController.h; sourceTree = "<group>"; };
29D0DCEF1DD9CABB00729692 /* PromotionChooseNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PromotionChooseNavigationController.m; sourceTree = "<group>"; };
29D260F31CEEAE2800A9787D /* FullScreenViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FullScreenViewController.h; sourceTree = "<group>"; }; 29D260F31CEEAE2800A9787D /* FullScreenViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FullScreenViewController.h; sourceTree = "<group>"; };
29D260F41CEEAE2800A9787D /* FullScreenViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FullScreenViewController.m; sourceTree = "<group>"; }; 29D260F41CEEAE2800A9787D /* FullScreenViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FullScreenViewController.m; sourceTree = "<group>"; };
29D260F61CEEAF2D00A9787D /* FullScreenViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FullScreenViewCell.h; sourceTree = "<group>"; }; 29D260F61CEEAF2D00A9787D /* FullScreenViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FullScreenViewCell.h; sourceTree = "<group>"; };
...@@ -483,6 +490,8 @@ ...@@ -483,6 +490,8 @@
29D260FC1CEED53400A9787D /* goodsDetailsTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = goodsDetailsTableViewCell.xib; sourceTree = "<group>"; }; 29D260FC1CEED53400A9787D /* goodsDetailsTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = goodsDetailsTableViewCell.xib; sourceTree = "<group>"; };
29D260FE1CEEF16D00A9787D /* MjRefreshHeaderCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MjRefreshHeaderCustom.h; sourceTree = "<group>"; }; 29D260FE1CEEF16D00A9787D /* MjRefreshHeaderCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MjRefreshHeaderCustom.h; sourceTree = "<group>"; };
29D260FF1CEEF16D00A9787D /* MjRefreshHeaderCustom.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MjRefreshHeaderCustom.m; sourceTree = "<group>"; }; 29D260FF1CEEF16D00A9787D /* MjRefreshHeaderCustom.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MjRefreshHeaderCustom.m; sourceTree = "<group>"; };
29D39E4C1DDAAD2B0009FF89 /* CustomPromotionModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomPromotionModel.h; sourceTree = "<group>"; };
29D39E4D1DDAAD2B0009FF89 /* CustomPromotionModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomPromotionModel.m; sourceTree = "<group>"; };
29D991DD1DCAE5B700840776 /* PromotionLuckyDrawModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PromotionLuckyDrawModel.h; sourceTree = "<group>"; }; 29D991DD1DCAE5B700840776 /* PromotionLuckyDrawModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PromotionLuckyDrawModel.h; sourceTree = "<group>"; };
29D991DE1DCAE5B700840776 /* PromotionLuckyDrawModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PromotionLuckyDrawModel.m; sourceTree = "<group>"; }; 29D991DE1DCAE5B700840776 /* PromotionLuckyDrawModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PromotionLuckyDrawModel.m; sourceTree = "<group>"; };
29E28CE61CE0B91B00812A55 /* HENLENSONG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HENLENSONG.h; sourceTree = "<group>"; }; 29E28CE61CE0B91B00812A55 /* HENLENSONG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HENLENSONG.h; sourceTree = "<group>"; };
...@@ -754,6 +763,8 @@ ...@@ -754,6 +763,8 @@
29D991DE1DCAE5B700840776 /* PromotionLuckyDrawModel.m */, 29D991DE1DCAE5B700840776 /* PromotionLuckyDrawModel.m */,
29B3EE6B1DCE0B390065FCCF /* PromotionLuckDrawResultModel.h */, 29B3EE6B1DCE0B390065FCCF /* PromotionLuckDrawResultModel.h */,
29B3EE6C1DCE0B390065FCCF /* PromotionLuckDrawResultModel.m */, 29B3EE6C1DCE0B390065FCCF /* PromotionLuckDrawResultModel.m */,
29D39E4C1DDAAD2B0009FF89 /* CustomPromotionModel.h */,
29D39E4D1DDAAD2B0009FF89 /* CustomPromotionModel.m */,
); );
name = model; name = model;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1319,6 +1330,8 @@ ...@@ -1319,6 +1330,8 @@
2903F93C1DBE57F4003CC6B1 /* JDEcardViewController.m */, 2903F93C1DBE57F4003CC6B1 /* JDEcardViewController.m */,
29D0DCDF1DD9B04A00729692 /* PromotionChooseViewController.h */, 29D0DCDF1DD9B04A00729692 /* PromotionChooseViewController.h */,
29D0DCE01DD9B04A00729692 /* PromotionChooseViewController.m */, 29D0DCE01DD9B04A00729692 /* PromotionChooseViewController.m */,
29D0DCEE1DD9CABB00729692 /* PromotionChooseNavigationController.h */,
29D0DCEF1DD9CABB00729692 /* PromotionChooseNavigationController.m */,
29A8D3951CD85A3C004D558F /* Clientdetails */, 29A8D3951CD85A3C004D558F /* Clientdetails */,
); );
name = controller; name = controller;
...@@ -1344,6 +1357,8 @@ ...@@ -1344,6 +1357,8 @@
2921F2F71DB5C7E400D6439B /* OrderDetailsSectionHeaderView.m */, 2921F2F71DB5C7E400D6439B /* OrderDetailsSectionHeaderView.m */,
2921F3041DB5F27A00D6439B /* PromotionalTableViewCell.h */, 2921F3041DB5F27A00D6439B /* PromotionalTableViewCell.h */,
2921F3051DB5F27A00D6439B /* PromotionalTableViewCell.m */, 2921F3051DB5F27A00D6439B /* PromotionalTableViewCell.m */,
29D0DCEB1DD9C59900729692 /* PromotionChooseTableViewCell.h */,
29D0DCEC1DD9C59900729692 /* PromotionChooseTableViewCell.m */,
); );
name = view; name = view;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1911,10 +1926,13 @@ ...@@ -1911,10 +1926,13 @@
2908870B1CE5A308000B7097 /* DateSelectedViewController.m in Sources */, 2908870B1CE5A308000B7097 /* DateSelectedViewController.m in Sources */,
299876271CD9837C00C90D0A /* OrderTableViewCell.m in Sources */, 299876271CD9837C00C90D0A /* OrderTableViewCell.m in Sources */,
295DEA9F1DB71EFC006ED4A6 /* RightControlSectionView.m in Sources */, 295DEA9F1DB71EFC006ED4A6 /* RightControlSectionView.m in Sources */,
29D0DCED1DD9C59900729692 /* PromotionChooseTableViewCell.m in Sources */,
2998763C1CD9983A00C90D0A /* CommodityListTableViewCell.m in Sources */, 2998763C1CD9983A00C90D0A /* CommodityListTableViewCell.m in Sources */,
2962D0791CD1CBC60058829D /* NetworkRequestClassManager.m in Sources */, 2962D0791CD1CBC60058829D /* NetworkRequestClassManager.m in Sources */,
29E2D32F1DB8AFD500443170 /* MDMatrix.m in Sources */, 29E2D32F1DB8AFD500443170 /* MDMatrix.m in Sources */,
29D39E4E1DDAAD2B0009FF89 /* CustomPromotionModel.m in Sources */,
29F725FB1CE17B0D0072FE0E /* Shoppersmanager.m in Sources */, 29F725FB1CE17B0D0072FE0E /* Shoppersmanager.m in Sources */,
29D0DCF01DD9CABB00729692 /* PromotionChooseNavigationController.m in Sources */,
2921F3061DB5F27A00D6439B /* PromotionalTableViewCell.m in Sources */, 2921F3061DB5F27A00D6439B /* PromotionalTableViewCell.m in Sources */,
2973C33B1DBEF2EC00FAC995 /* ClientShoppingCarViewController.m in Sources */, 2973C33B1DBEF2EC00FAC995 /* ClientShoppingCarViewController.m in Sources */,
293164001DCE3F6D0075129D /* NotDrawTableViewCell.m in Sources */, 293164001DCE3F6D0075129D /* NotDrawTableViewCell.m in Sources */,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -41,14 +41,15 @@ ...@@ -41,14 +41,15 @@
*/ */
- (UIStoryboard *)getStoryboardWithName; - (UIStoryboard *)getStoryboardWithName;
/** /**
* 调用打印机 * 调用打印机
*/ */
- (void)callAirprintWithdata:(NSString *)PDFpath SuccessBlock:(void(^)())success ErrorBlock:(void(^)())failed; - (void)callAirprintWithdata:(NSString *)PDFpath SuccessBlock:(void(^)())success ErrorBlock:(void(^)())failed;
/**
* 判断是否有相机权限
*/
+ (BOOL)determineCameraPermissions;
/** /**
* 成功等待视图 * 成功等待视图
...@@ -60,7 +61,6 @@ ...@@ -60,7 +61,6 @@
*/ */
- (void)ErrorMBProgressView:(NSString *)errorString; - (void)ErrorMBProgressView:(NSString *)errorString;
/** /**
* 纯文本提示框 * 纯文本提示框
*/ */
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#import "BaseViewController.h" #import "BaseViewController.h"
#import "LoginViewController.h" #import "LoginViewController.h"
#import <WebKit/WebKit.h> #import <WebKit/WebKit.h>
#import <AVFoundation/AVFoundation.h>
@interface BaseViewController ()<UIPrintInteractionControllerDelegate,UIWebViewDelegate,WKNavigationDelegate> @interface BaseViewController ()<UIPrintInteractionControllerDelegate,UIWebViewDelegate,WKNavigationDelegate>
...@@ -235,6 +236,18 @@ ...@@ -235,6 +236,18 @@
return storyboard; return storyboard;
} }
#pragma mark - 判断相机权限
+ (BOOL)determineCameraPermissions
{
NSString *mediaType = AVMediaTypeVideo;//读取媒体类型
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:mediaType];//读取设备授权状态
if(authStatus == AVAuthorizationStatusRestricted || authStatus == AVAuthorizationStatusDenied){
return NO;
}else {
return YES;
}
}
#pragma mark 调用airPrint无线打印机 #pragma mark 调用airPrint无线打印机
- (void)callAirprintWithdata:(NSString *)PDFpath SuccessBlock:(void(^)())success ErrorBlock:(void(^)())failed - (void)callAirprintWithdata:(NSString *)PDFpath SuccessBlock:(void(^)())success ErrorBlock:(void(^)())failed
{ {
......
...@@ -152,13 +152,9 @@ ...@@ -152,13 +152,9 @@
{ {
[_session addOutput:self.output]; [_session addOutput:self.output];
} }
AVCaptureConnection *outputConnection = [_output connectionWithMediaType:AVMediaTypeVideo]; AVCaptureConnection *outputConnection = [_output connectionWithMediaType:AVMediaTypeVideo];
outputConnection.videoOrientation = [QRUtil videoOrientationFromCurrentDeviceOrientation]; outputConnection.videoOrientation = [QRUtil videoOrientationFromCurrentDeviceOrientation];
// 条码类型 AVMetadataObjectTypeQRCode // 条码类型 AVMetadataObjectTypeQRCode
// _output.metadataObjectTypes =@[AVMetadataObjectTypeQRCode];
_output.metadataObjectTypes = @[AVMetadataObjectTypeEAN13Code, _output.metadataObjectTypes = @[AVMetadataObjectTypeEAN13Code,
AVMetadataObjectTypeEAN8Code, AVMetadataObjectTypeEAN8Code,
AVMetadataObjectTypeCode128Code, AVMetadataObjectTypeCode128Code,
...@@ -169,9 +165,7 @@ ...@@ -169,9 +165,7 @@
_preview.videoGravity =AVLayerVideoGravityResize; _preview.videoGravity =AVLayerVideoGravityResize;
_preview.frame =[QRUtil screenBounds]; _preview.frame =[QRUtil screenBounds];
[self.view.layer insertSublayer:_preview atIndex:0]; [self.view.layer insertSublayer:_preview atIndex:0];
_preview.connection.videoOrientation = [QRUtil videoOrientationFromCurrentDeviceOrientation]; _preview.connection.videoOrientation = [QRUtil videoOrientationFromCurrentDeviceOrientation];
[_session startRunning]; [_session startRunning];
} }
......
...@@ -474,7 +474,7 @@ ...@@ -474,7 +474,7 @@
#pragma mark -获取商品列表数据 #pragma mark -获取商品列表数据
- (void)getGoodsListDatasisRemove:(BOOL)remove Withobject:(GoodsCondition *)conditon - (void)getGoodsListDatasisRemove:(BOOL)remove Withobject:(GoodsCondition *)conditon
{ {
__weak typeof(self)weakSelf = self; WS(weakSelf);
[self getGoodsListdatas:conditon returnResponse:^(GoodsResponse *response) { [self getGoodsListdatas:conditon returnResponse:^(GoodsResponse *response) {
weakSelf.sceneOrProductClollectionView.emptyDataSetSource = weakSelf; weakSelf.sceneOrProductClollectionView.emptyDataSetSource = weakSelf;
...@@ -524,7 +524,7 @@ ...@@ -524,7 +524,7 @@
newModel.pictures = model.pictures; newModel.pictures = model.pictures;
newModel.barcode = model.barcode; newModel.barcode = model.barcode;
newModel.isSelectedState = NO; newModel.isSelectedState = NO;
newModel.goodsNumber = 1; newModel.goodsNumber = ONE;
[weakSelf.productDatasArray addObject:newModel]; [weakSelf.productDatasArray addObject:newModel];
} }
for (TOGoodsEntityModel *model in SHARED_APPDELEGATE.productArray) { for (TOGoodsEntityModel *model in SHARED_APPDELEGATE.productArray) {
...@@ -542,7 +542,7 @@ ...@@ -542,7 +542,7 @@
- (void)getGoodsListdatas:(GoodsCondition *)conditon returnResponse:(void(^)(GoodsResponse *))finish - (void)getGoodsListdatas:(GoodsCondition *)conditon returnResponse:(void(^)(GoodsResponse *))finish
{ {
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(PRODUCTLIST) WithCallClass:weakSelf WithRequestType:0 WithParameter:conditon WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(PRODUCTLIST) WithCallClass:weakSelf WithRequestType:ZERO WithParameter:conditon WithReturnValueBlock:^(id returnValue) {
[weakSelf endRefreshingForTableView:weakSelf.sceneOrProductClollectionView]; [weakSelf endRefreshingForTableView:weakSelf.sceneOrProductClollectionView];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
......
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
cell.clinchTextfield.userInteractionEnabled = NO; cell.clinchTextfield.userInteractionEnabled = NO;
cell.ClinchPriceBackView.backgroundColor = cell.backgroundColor; cell.ClinchPriceBackView.backgroundColor = cell.backgroundColor;
//cell选中回调 //cell选中回调
__weak typeof(self) weakSelf = self; WS(weakSelf);
[cell setReturnCellblock:^(NSInteger index) { [cell setReturnCellblock:^(NSInteger index) {
[weakSelf setSelectedButton:index]; [weakSelf setSelectedButton:index];
......
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