Commit d662c6ea authored by 曹云霄's avatar 曹云霄

debug

parent c7d75cd2
......@@ -121,7 +121,6 @@
headerRefresh.lastUpdatedTimeLabel.hidden = YES;
self.allCustomerTableview.mj_header = headerRefresh;
[self.allCustomerTableview.mj_header beginRefreshing];
self.allCustomerTableview.mj_footer.automaticallyHidden = YES;
//上拉加载
self.allCustomerTableview.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
......@@ -136,6 +135,7 @@
[self getShoppersAssociatedCustomer:self.conditionModel isRemove:NO];
}
}];
self.allCustomerTableview.mj_footer.automaticallyHidden = YES;
}
......@@ -253,7 +253,9 @@
UIPopoverPresentationController *pop = datevc.popoverPresentationController;
pop.permittedArrowDirections = UIPopoverArrowDirectionAny;
pop.sourceView = datevc.view;
[self presentViewController:datevc animated:YES completion:nil];
dispatch_async(dispatch_get_main_queue(), ^{
[self presentViewController:datevc animated:YES completion:nil];
});
}
......
......@@ -27,7 +27,7 @@
self.goodsCraneQuotation.text = [NSString stringWithFormat:@"¥%.2f",[_model.goods.tagPrice floatValue]];
self.goodsSpecifications.text = _model.goods.size;
self.clinchPrice.text = [NSString stringWithFormat:@"¥%.2f",[_model.goods.costPrice floatValue]];
self.goodsNumber.text = [NSString stringWithFormat:@"%d",_model.goodsNum];
self.goodsNumber.text = [NSString stringWithFormat:@"%ld",(long)_model.goodsNum];
self.goodsPrice.text = [NSString stringWithFormat:@"¥%.2f",[_model.goods.costPrice floatValue]*_model.goodsNum];
......
......@@ -29,6 +29,11 @@
*/
@property (nonatomic,assign) int totalPages;
/**
* 查询条件
*/
@property (nonatomic,strong) ConsumerQueryCondition *condition;
@end
@implementation ClientViewController
......@@ -46,6 +51,14 @@
return _CustomerresultArray;
}
- (ConsumerQueryCondition *)condition
{
if (!_condition) {
_condition = [[ConsumerQueryCondition alloc]init];
}
return _condition;
}
- (void)viewDidLoad {
[super viewDidLoad];
......@@ -104,61 +117,61 @@
//清空当前客户数据
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ChangeCustomerName:) name:@"EMPTYCUSTOMERNAME" object:nil];
__weak typeof(self) weakSelf = self;
//下拉刷新
MjRefreshHeaderCustom *headerRefresh = [MjRefreshHeaderCustom headerWithRefreshingBlock:^{
ConsumerQueryCondition *condition = [[ConsumerQueryCondition alloc]init];
condition.resellerCodeEquals = [[Shoppersmanager manager].Shoppers.employee.currentDepart orgCode];
weakSelf.condition.resellerCodeEquals = [[Shoppersmanager manager].Shoppers.employee.currentDepart orgCode];
DataPage *page = [[DataPage alloc]init];
page.page = 1;
condition.page = page;
weakSelf.condition.page = page;
page.rows = KROWS;
self.indexPage = 1;
[self.informationTableview.mj_footer resetNoMoreData];
[self getShoppersAssociatedCustomer:condition isRemoveArray:YES];
weakSelf.indexPage = 1;
[weakSelf.informationTableview.mj_footer resetNoMoreData];
[weakSelf getShoppersAssociatedCustomer:weakSelf.condition isRemoveArray:YES];
}];
headerRefresh.stateLabel.hidden = YES;
headerRefresh.lastUpdatedTimeLabel.hidden = YES;
self.informationTableview.mj_header =headerRefresh;
self.informationTableview.mj_footer.automaticallyHidden = YES;
//进入刷新状态
[self.informationTableview.mj_header beginRefreshing];
//上拉加载
self.informationTableview.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
if (++ self.indexPage > self.totalPages) {
[self.informationTableview.mj_footer endRefreshingWithNoMoreData];
if (++ weakSelf.indexPage > weakSelf.totalPages) {
[weakSelf.informationTableview.mj_footer endRefreshingWithNoMoreData];
}else
{
ConsumerQueryCondition *condition = [[ConsumerQueryCondition alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = self.indexPage;
page.page = weakSelf.indexPage;
page.rows = KROWS;
condition.page = page;
[self getShoppersAssociatedCustomer:condition isRemoveArray:NO];
weakSelf.condition.page = page;
[weakSelf getShoppersAssociatedCustomer:weakSelf.condition isRemoveArray:NO];
}
}];
self.informationTableview.mj_footer.automaticallyHidden = YES;
}
#pragma mark -获取导购关联客户
- (void)getShoppersAssociatedCustomer:(ConsumerQueryCondition *)condition isRemoveArray:(BOOL)remove
{
__weak typeof(self) weakSelf = self;
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(GETSHOPPERSCONSUMER) WithRequestType:0 WithParameter:condition WithReturnValueBlock:^(id returnValue) {
self.informationTableview.emptyDataSetSource = self;
self.informationTableview.emptyDataSetDelegate = self;
[self RemoveMBProgressHUDLoding];
[self endRefreshingForTableView:self.informationTableview];
weakSelf.informationTableview.emptyDataSetSource = weakSelf;
weakSelf.informationTableview.emptyDataSetDelegate = weakSelf;
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf endRefreshingForTableView:weakSelf.informationTableview];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
if (remove) {
[self.CustomerresultArray removeAllObjects];
[weakSelf.CustomerresultArray removeAllObjects];
}
NSDictionary *datas = returnValue[@"data"];
ConsumerPageResult *Customerresult = [[ConsumerPageResult alloc]initWithDictionary:datas error:nil];
self.totalPages = [datas[@"totalpages"] intValue];
weakSelf.totalPages = [datas[@"totalpages"] intValue];
for (TOConsumerEntity *objc in Customerresult.results) {
MyclientEntityModel *myclientModel = [[MyclientEntityModel alloc]init];
......@@ -177,32 +190,32 @@
myclientModel.lastVisitedTime = objc.lastVisitedTime;
myclientModel.company = objc.company;
[self.CustomerresultArray addObject:myclientModel];
[weakSelf.CustomerresultArray addObject:myclientModel];
}
//刷新后添加选中状态
for (int i=0; i<self.CustomerresultArray.count; i++) {
MyclientEntityModel *myclientModel = [self.CustomerresultArray objectAtIndex_opple:i];
for (int i=0; i<weakSelf.CustomerresultArray.count; i++) {
MyclientEntityModel *myclientModel = [weakSelf.CustomerresultArray objectAtIndex_opple:i];
if ([[Customermanager manager].model.fid isEqualToString:myclientModel.fid]) {
InformationTableViewCell *cell = [self.informationTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:i inSection:0]];
InformationTableViewCell *cell = [weakSelf.informationTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:i inSection:0]];
myclientModel.selectedState = YES;
cell.setCurrentCustomer.selected = YES;
}
}
[self.informationTableview reloadData];
[weakSelf.informationTableview reloadData];
}
else
{
[self ErrorMBProgressView:returnValue[@"message"]];
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[self RemoveMBProgressHUDLoding];
[self promptCustomerWithString:@"网络连接已断开"];
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf promptCustomerWithString:@"网络连接已断开"];
} WithFailureBlock:^(id error) {
[self RemoveMBProgressHUDLoding];
[self endRefreshingForTableView:self.informationTableview];
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf endRefreshingForTableView:weakSelf.informationTableview];
}];
}
......@@ -214,8 +227,9 @@
cell.indexNumber = indexPath.row;
cell.model = [self.CustomerresultArray objectAtIndex_opple:indexPath.row];
//清空其他选中状态
__weak typeof(self) weakSelf = self;
[cell setBlockSeletced:^(NSInteger index) {
[self SetCustomerButtonClick:index];
[weakSelf SetCustomerButtonClick:index];
}];
return cell;
}
......@@ -238,16 +252,17 @@
clientdetails.model = [self.CustomerresultArray objectAtIndex_opple:indexPath.row];
clientdetails.cellindex = indexPath.row;
//设置当前客户
__weak typeof(self) weakSelf = self;
[clientdetails setCurrentUserBlock:^(NSInteger index,NSString *title) {
if ([title isEqualToString:@"设为当前客户"]) {
InformationTableViewCell *cell = [self.informationTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0]];
[self SetCustomerButtonClick:index];
InformationTableViewCell *cell = [weakSelf.informationTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0]];
[weakSelf SetCustomerButtonClick:index];
cell.setCurrentCustomer.selected = YES;
}else if ([title isEqualToString:@"退出当前客户"])
{
[self ExitCurrentCustomer];
[self.addpersonInformationButton setTitle:@"添加客户信息" forState:UIControlStateNormal];
[weakSelf ExitCurrentCustomer];
[weakSelf.addpersonInformationButton setTitle:@"添加客户信息" forState:UIControlStateNormal];
}
}];
[self.navigationController pushViewController:clientdetails animated:YES];
......@@ -350,7 +365,9 @@
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
[PcCamera setSourceType:UIImagePickerControllerSourceTypeCamera];
PcCamera.allowsEditing = YES;
[weakSelf presentViewController:PcCamera animated:YES completion:nil];
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf presentViewController:PcCamera animated:YES completion:nil];
});
}
else
{
......@@ -362,7 +379,9 @@
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
[PcCamera setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
PcCamera.allowsEditing = YES;
[weakSelf presentViewController:PcCamera animated:YES completion:nil];
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf presentViewController:PcCamera animated:YES completion:nil];
});
}
else
{
......@@ -372,7 +391,9 @@
[alertView addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
[alertView dismissViewControllerAnimated:YES completion:nil];
}]];
[self presentViewController:alertView animated:YES completion:nil];
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf presentViewController:alertView animated:YES completion:nil];
});
}
#pragma mark -拍照、从相册选择
......@@ -387,12 +408,12 @@
[self uploadUserHeader:Headimage completeBlock:^(NSString *string) {
weskSelf.customerHeader.image = Headimage;
[Customermanager manager].model.picture = string;
for (int i=0;i<self.CustomerresultArray.count;i++) {
MyclientEntityModel *customerModel = (MyclientEntityModel *)[self.CustomerresultArray objectAtIndex_opple:i];
for (int i=0;i<weskSelf.CustomerresultArray.count;i++) {
MyclientEntityModel *customerModel = (MyclientEntityModel *)[weskSelf.CustomerresultArray objectAtIndex_opple:i];
if ([customerModel.fid isEqualToString:[Customermanager manager].model.fid]) {
customerModel.picture = string;
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:i inSection:0];
[self.informationTableview reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationBottom];
[weskSelf.informationTableview reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationBottom];
break;
}
}
......@@ -448,21 +469,22 @@
MyclientEntityModel *customerEntity = [[MyclientEntityModel alloc]init];
customerEntity = [Customermanager manager].model;
customerEntity.picture = headerurl;
__weak typeof(self) weskSelf = self;
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(ADDCONSUMER) WithRequestType:0 WithParameter:customerEntity WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding];
[weskSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
block();
[self SuccessMBProgressView:@"修改成功"];
[weskSelf SuccessMBProgressView:@"修改成功"];
}else
{
[self ErrorMBProgressView:returnValue[@"message"]];
[weskSelf ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[self RemoveMBProgressHUDLoding];
[weskSelf RemoveMBProgressHUDLoding];
} WithFailureBlock:^(NSError *error) {
[self RemoveMBProgressHUDLoding];
[weskSelf RemoveMBProgressHUDLoding];
}];
}
......@@ -487,6 +509,7 @@
#pragma mark -设置为当前用户请求、写入访问时间
- (void)SetupUserRequest
{
__weak typeof(self) weskSelf = self;
MyclientEntityModel *model = [Customermanager manager].model;
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(SAVEVISITEDTIME),model.fid] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
......@@ -496,7 +519,7 @@
} WithErrorCodeBlock:^(id errorCodeValue) {
[self promptCustomerWithString:@"网络连接已断开"];
[weskSelf promptCustomerWithString:@"网络连接已断开"];
} WithFailureBlock:^(id error) {
......@@ -580,52 +603,52 @@
if (isChange) {
customerEntity.fid = [Customermanager manager].model.fid;
}
__weak typeof(self) weskSelf = self;
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(ADDCONSUMER) WithRequestType:0 WithParameter:customerEntity WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding];
[weskSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
//进入刷新状态
[self.informationTableview.mj_header beginRefreshing];
[weskSelf.informationTableview.mj_header beginRefreshing];
//新增保存ID
if (!isChange) {
customerEntity.fid = returnValue[@"data"];
[Customermanager manager].model = customerEntity;
[self SuccessMBProgressView:@"新增成功"];
[self addAddressInformationRequest];
[weskSelf SuccessMBProgressView:@"新增成功"];
[weskSelf addAddressInformationRequest];
}else
{
[self SuccessMBProgressView:@"修改成功"];
[self.changePersonInformationButton setTitle:@"更改客户信息" forState:UIControlStateNormal];
[weskSelf SuccessMBProgressView:@"修改成功"];
[weskSelf.changePersonInformationButton setTitle:@"更改客户信息" forState:UIControlStateNormal];
}
//保存客户信息
[Customermanager manager].model = customerEntity;
[Shoppersmanager manager].currentCustomer = YES;
[self.addpersonInformationButton setTitle:@"退出当前客户" forState:UIControlStateNormal];
self.changePersonInformationButton.hidden = NO;
self.customerNameField.enabled = NO;
self.customerAddress.enabled = NO;
self.phoneNumberField.enabled = NO;
self.companyNameField.enabled = NO;
[self SetupUserShoppingCarNumberRequest];
[self SetupUserRequest];
[self ChangeCustomerName];
[weskSelf.addpersonInformationButton setTitle:@"退出当前客户" forState:UIControlStateNormal];
weskSelf.changePersonInformationButton.hidden = NO;
weskSelf.customerNameField.enabled = NO;
weskSelf.customerAddress.enabled = NO;
weskSelf.phoneNumberField.enabled = NO;
weskSelf.companyNameField.enabled = NO;
[weskSelf SetupUserShoppingCarNumberRequest];
[weskSelf SetupUserRequest];
[weskSelf ChangeCustomerName];
}
else
{
[self ErrorMBProgressView:returnValue[@"message"]];
[weskSelf ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[self RemoveMBProgressHUDLoding];
[self promptCustomerWithString:@"网络连接已断开"];
[weskSelf RemoveMBProgressHUDLoding];
[weskSelf promptCustomerWithString:@"网络连接已断开"];
} WithFailureBlock:^(id error) {
[self RemoveMBProgressHUDLoding];
[weskSelf RemoveMBProgressHUDLoding];
}];
}
......@@ -640,7 +663,7 @@
address.name = self.customerNameField.text;
address.miblephone = self.phoneNumberField.text;
address.address = self.customerAddress.text;
__weak typeof(self) weskSelf = self;
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(ADDADDRESS) WithRequestType:0 WithParameter:address WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) {
......@@ -649,12 +672,12 @@
}
else
{
[self ErrorMBProgressView:returnValue[@"message"]];
[weskSelf ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[self promptCustomerWithString:@"网络连接已断开"];
[weskSelf promptCustomerWithString:@"网络连接已断开"];
} WithFailureBlock:^(id error) {
......@@ -700,62 +723,13 @@
- (void)searchCustomerInforMation
{
if (self.searchPersonInformationField.text.length == 0) {
[self ErrorMBProgressView:@"搜索信息不能为空"];
return;
self.condition.nameEquals = nil;
self.condition.mobileEquals = nil;
}else {
self.condition.nameEquals = self.searchPersonInformationField.text;
self.condition.mobileEquals = self.searchPersonInformationField.text;
}
[self CreateMBProgressHUDLoding];
ConsumerQueryCondition *searchCustomer = [[ConsumerQueryCondition alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = 1;
page.rows = 10;
searchCustomer.page = page;
searchCustomer.nameEquals = self.searchPersonInformationField.text;
searchCustomer.mobileEquals = self.searchPersonInformationField.text;
//request
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(GETSHOPPERSCONSUMER) WithRequestType:0 WithParameter:searchCustomer WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
ConsumerPageResult *result = [[ConsumerPageResult alloc]initWithDictionary:returnValue[@"data"] error:nil];
[self.CustomerresultArray removeAllObjects];
for (TOConsumerEntity *objc in result.results) {
MyclientEntityModel *myclientModel = [[MyclientEntityModel alloc]init];
myclientModel.fid = objc.fid;
myclientModel.createName = objc.createName;
myclientModel.createBy = objc.createBy;
myclientModel.createDate = objc.createDate;
myclientModel.sysOrgCode = objc.sysOrgCode;
myclientModel.name = objc.name;
myclientModel.mobile = objc.mobile;
myclientModel.province = objc.province;
myclientModel.city = objc.city;
myclientModel.country = objc.country;
myclientModel.address = objc.address;
myclientModel.picture = objc.picture;
myclientModel.lastVisitedTime = objc.lastVisitedTime;
[self.CustomerresultArray addObject:myclientModel];
}
[self.informationTableview reloadData];
}
else
{
[self ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[self RemoveMBProgressHUDLoding];
[self promptCustomerWithString:@"网络连接已断开"];
} WithFailureBlock:^(id error) {
[self RemoveMBProgressHUDLoding];
}];
[self.informationTableview.mj_header beginRefreshing];
}
......@@ -796,6 +770,11 @@
return YES;
}
- (CGFloat)verticalOffsetForEmptyDataSet:(UIScrollView *)scrollView
{
return 100;
}
@end
......@@ -156,7 +156,6 @@
headerRefresh.stateLabel.hidden = YES;
headerRefresh.lastUpdatedTimeLabel.hidden = YES;
self.ClientdetailsTableview.mj_header =headerRefresh;
self.ClientdetailsTableview.mj_footer.automaticallyHidden = YES;
//进入刷新状态
[self.ClientdetailsTableview.mj_header beginRefreshing];
//上拉加载
......@@ -195,6 +194,8 @@
}
}
}];
self.ClientdetailsTableview.mj_footer.automaticallyHidden = YES;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
......
......@@ -24,7 +24,7 @@
self.goodsName.text = _model.goods.name;
self.specifications.text = _model.goods.size;
self.goodsCode.text = _model.goods.code;
self.goodsNumber.text = [NSString stringWithFormat:@"数量 X%d",_model.goodsNum];
self.goodsNumber.text = [NSString stringWithFormat:@"数量 X%ld",(long)_model.goodsNum];
self.clinchPrice.text = [NSString stringWithFormat:@"成交价 ¥%.2f",[_model.costPrice floatValue]];
//计算总价格
NSInteger number = _model.goodsNum;
......
......@@ -111,7 +111,6 @@
headerRefresh.lastUpdatedTimeLabel.hidden = YES;
self.customerOrderTableView.mj_header = headerRefresh;
[self.customerOrderTableView.mj_header beginRefreshing];
self.customerOrderTableView.mj_footer.automaticallyHidden = YES;
//上拉加载
self.customerOrderTableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
......@@ -126,6 +125,8 @@
[weakSelf getGuideAllcustomerOrder:NO WithorderBill:weakSelf.model];
}
}];
self.customerOrderTableView.mj_footer.automaticallyHidden = YES;
}
......
......@@ -284,7 +284,6 @@
headerRefresh.lastUpdatedTimeLabel.hidden = YES;
self.productCollectionView.mj_header = headerRefresh;
[self.productCollectionView.mj_header beginRefreshing];
self.productCollectionView.mj_footer.automaticallyHidden = YES;
//上拉加载
self.productCollectionView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
......@@ -344,6 +343,8 @@
}
}
}];
self.productCollectionView.mj_footer.automaticallyHidden = YES;
}
......
......@@ -144,7 +144,6 @@
headerRefresh.lastUpdatedTimeLabel.hidden = YES;
self.seceneLibararyCollectionView.mj_header = headerRefresh;
[self.seceneLibararyCollectionView.mj_header beginRefreshing];
self.seceneLibararyCollectionView.mj_footer.automaticallyHidden = YES;
//上拉加载
self.seceneLibararyCollectionView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
......@@ -160,6 +159,8 @@
[self getSceneLibrarydatas:self.conditionModel isRemove:NO];
}
}];
self.seceneLibararyCollectionView.mj_footer.automaticallyHidden = YES;
}
#pragma mark -获取场景筛选数据
......
......@@ -187,7 +187,6 @@
{
ProductDetailsViewController *productDetails = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"productdetails"];
productDetails.goodsID = [[self.shopResponseArray objectAtIndex_opple:indexPath.row] goodsId];
// productDetails.inventory = [[self.shopResponseArray objectAtIndex_opple:indexPath.row] inv];
[self.navigationController pushViewController:productDetails animated:YES];
}
......
......@@ -22,6 +22,7 @@
#import "BaseViewController.h"
#import "QRViewController.h"
#import "ExperienceCentreViewController.h"
#import <AVFoundation/AVFoundation.h>
@interface CustomTabbarController ()<TabbarButtonClickdelegate,ChangpasswordDelegate,CancelButtondelegate,UITextFieldDelegate>
......@@ -37,6 +38,11 @@
*/
@property (nonatomic,strong) NSArray *vcArray;
/**
* 工具栏
*/
@property (nonatomic,strong) Toolview *toolview;
@end
@implementation CustomTabbarController
......@@ -94,12 +100,11 @@
- (void)uiConfigAction
{
self.tabBar.frame = CGRectMake(Zero, Zero, ScreenWidth, NavigationHeight);
Toolview *toolview = [[Toolview alloc]initWithFrame:CGRectMake(Zero, Zero, ScreenWidth, NavigationHeight)];
toolview.delegate = self;
toolview.inputField.delegate = self;
self.toolview = [[Toolview alloc]initWithFrame:CGRectMake(Zero, Zero, ScreenWidth, NavigationHeight)];
self.toolview.delegate = self;
self.toolview.inputField.delegate = self;
self.delegate = self;
[self.tabBar addSubview:toolview];
[self.tabBar addSubview:self.toolview];
//显示体验中心
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ShowFollowHeart:) name:@"FollowHeartVC" object:nil];
}
......@@ -113,7 +118,6 @@
SearchViewController *searchVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:0]];
ShoppingViewController *shoppingVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:1]];
ClientViewController *clientVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:2]];
SceneLibraryViewController *sceneVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:4]];
ProductLibraryViewController *productVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:5]];
CustomerManagementViewController *customerVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:6]];
......@@ -142,9 +146,7 @@
#pragma mark -移除系统自带的UITabBarButton
- (void)viewWillLayoutSubviews {
[super viewWillLayoutSubviews];
for (UIView *view in self.tabBar.subviews) {
if ([view isKindOfClass:NSClassFromString(@"UITabBarButton")]) {
[view removeFromSuperview];
}
......@@ -155,13 +157,14 @@
#pragma amrk -TabbarButtonClickdelegate代理
- (void)ButtonClickAction:(NSInteger)Buttontag withButton:(UIButton *)button
{
[self.toolview.inputField resignFirstResponder];
[self dismissViewControllerAnimated:NO completion:nil];
_Newbutton = button;
switch (Buttontag) {
//右侧视图
case 100:
[self dismissViewControllerAnimated:YES completion:nil];
[SHARED_APPDELEGATE.mmdrawer toggleDrawerSide:MMDrawerSideRight animated:YES completion:nil];
break;
......@@ -185,7 +188,6 @@
//我的客户
case 102:
[self dismissViewControllerAnimated:YES completion:nil];
self.selectedIndex = 6;
break;
......@@ -193,7 +195,6 @@
//购物车
case 103:
[self dismissViewControllerAnimated:YES completion:nil];
//必须设置当前客户才能跳转到购物车
if (![Shoppersmanager manager].currentCustomer) {
......@@ -255,21 +256,38 @@
}];
}
#pragma mark -二维码扫描
- (void)QrcodeButtonClick
{
QRViewController *qrVC = [[QRViewController alloc] initWithScanCompleteHandler:^(NSString *url) {
[self dismissViewControllerAnimated:YES completion:^{
ProductLibraryViewController *product = [SHARED_APPDELEGATE.allControllerArray objectAtIndex_opple:4];
product.barcode = url;
self.selectedIndex = 4;
__weak typeof(self) weakSelf = self;
//判断权限
AVAuthorizationStatus status = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
if(status !=AVAuthorizationStatusAuthorized) {
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) {
[weakSelf dismissViewControllerAnimated:YES completion:nil];
}]];
[self presentViewController:alertVC animated:YES completion:nil];
}else {
QRViewController *qrVC = [[QRViewController alloc] initWithScanCompleteHandler:^(NSString *url) {
[self dismissViewControllerAnimated:YES completion:^{
ProductLibraryViewController *product = [SHARED_APPDELEGATE.allControllerArray objectAtIndex_opple:4];
product.barcode = url;
self.selectedIndex = 4;
}];
}];
}];
[self presentViewController:qrVC animated:YES completion:nil];
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf presentViewController:qrVC animated:YES completion:nil];
});
}
}
......@@ -287,7 +305,6 @@
#pragma mark -Search按钮
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
//搜索
if (textField.text.length != 0) {
......@@ -340,28 +357,8 @@
UIPopoverPresentationController *popover = ExperienceCenter.popoverPresentationController;
popover.sourceView = ExperienceCenter.view;
[self presentViewController:ExperienceCenter animated:YES completion:nil];
// FollowHeartViewController *followVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:3]];
// [self presentViewController:followVC animated:YES completion:nil];
}
}
#pragma mark -禁止跳转
//- (void)
- (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
......@@ -184,7 +184,6 @@
}
}
//点击代理
if ([self.delegate respondsToSelector:@selector(ButtonClickAction:withButton:)]) {
......
......@@ -40,6 +40,14 @@
<string>wb1111393286</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>prefs</string>
</array>
</dict>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
......
......@@ -487,7 +487,9 @@
[self dismissViewControllerAnimated:YES completion:nil];
}]];
[self presentViewController:alertVC animated:YES completion:nil];
dispatch_async(dispatch_get_main_queue(), ^{
[self presentViewController:alertVC animated:YES completion:nil];
});
}
......
......@@ -132,12 +132,10 @@
- (void)startRunning {
_device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
// Input
_input = [AVCaptureDeviceInput deviceInputWithDevice:self.device error:nil];
// Output
_output = [[AVCaptureMetadataOutput alloc]init];
[_output setMetadataObjectsDelegate:self queue:dispatch_get_main_queue()];
......
......@@ -289,7 +289,6 @@
headerRefresh.lastUpdatedTimeLabel.hidden = YES;
self.sceneOrProductClollectionView.mj_header = headerRefresh;
[self.sceneOrProductClollectionView.mj_header beginRefreshing];
self.sceneOrProductClollectionView.mj_footer.automaticallyHidden = YES;
//上拉加载
self.sceneOrProductClollectionView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
......@@ -306,6 +305,8 @@
[weakSelf getSceneLibrarydatas:weakSelf.conditionModel isRemove:NO];
}
}];
self.sceneOrProductClollectionView.mj_footer.automaticallyHidden = YES;
}
......@@ -382,7 +383,6 @@
headerRefresh.lastUpdatedTimeLabel.hidden = YES;
self.sceneOrProductClollectionView.mj_header = headerRefresh;
[self.sceneOrProductClollectionView.mj_header beginRefreshing];
self.sceneOrProductClollectionView.mj_footer.automaticallyHidden = YES;
//上拉加载
self.sceneOrProductClollectionView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
......@@ -399,6 +399,8 @@
[weakSelf getGoodsListDatasisRemove:NO Withobject:weakSelf.goodsModel];
}
}];
self.sceneOrProductClollectionView.mj_footer.automaticallyHidden = YES;
}
......
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