Commit 87d435d5 authored by 勾芒's avatar 勾芒

debug

parent fe3c961e
......@@ -177,6 +177,7 @@
myclientModel.country = objc.country;
myclientModel.address = objc.address;
myclientModel.picture = objc.picture;
myclientModel.company = objc.company;
myclientModel.lastVisitedTime = objc.lastVisitedTime;
[self.CustomerresultArray addObject:myclientModel];
......
......@@ -187,7 +187,7 @@
//刷新后添加选中状态
for (int i=0; i<self.CustomerresultArray.count; i++) {
MyclientEntityModel *myclientModel = [self.CustomerresultArray objectAtIndex_opple:i];
if ([[Customermanager manager].customerID isEqualToString:myclientModel.fid]) {
if ([[Customermanager manager].model.fid isEqualToString:myclientModel.fid]) {
InformationTableViewCell *cell = [self.informationTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:i inSection:0]];
myclientModel.selectedState = YES;
cell.setCurrentCustomer.selected = YES;
......@@ -284,12 +284,7 @@
[self.customerHeader sd_setImageWithURL:[NSURL URLWithString:model.picture] placeholderImage:TCImage(@"now")];
//保存客户信息
[Shoppersmanager manager].currentCustomer = YES;
[Customermanager manager].customerID = model.fid;
[Customermanager manager].customerName = model.name;
[Customermanager manager].customerPhoneNumber = model.mobile;
[Customermanager manager].companyName = model.company;
[Customermanager manager].cutomerAddress = model.address;
[Customermanager manager].header = model.picture;
[Customermanager manager].model = model;
[self.addpersonInformationButton setTitle:@"退出当前客户" forState:UIControlStateNormal];
self.changePersonInformationButton.hidden = NO;
[self SetupUserShoppingCarNumberRequest];
......@@ -324,15 +319,11 @@
self.customerNameField.text = model.name;
self.phoneNumberField.text = model.mobile;
self.customerAddress.text = model.address;
self.companyNameField.text = model.company;
[self.customerHeader sd_setImageWithURL:[NSURL URLWithString:model.picture] placeholderImage:TCImage(@"now")];
//保存客户信息
[Shoppersmanager manager].currentCustomer = YES;
[Customermanager manager].customerID = model.fid;
[Customermanager manager].customerName = model.name;
[Customermanager manager].customerPhoneNumber = model.mobile;
[Customermanager manager].companyName = model.company;
[Customermanager manager].cutomerAddress = model.address;
[Customermanager manager].header = model.picture;
[Customermanager manager].model = model;
[self.addpersonInformationButton setTitle:@"退出当前客户" forState:UIControlStateNormal];
self.changePersonInformationButton.hidden = NO;
[self SetupUserShoppingCarNumberRequest];
......@@ -349,7 +340,8 @@
#pragma mark -更新用户名字
- (void)ChangeCustomerName
{
[[NSNotificationCenter defaultCenter] postNotificationName:@"CHANGECUSTOMERNAME" object:[Customermanager manager].customerName];
MyclientEntityModel *model = [Customermanager manager].model;
[[NSNotificationCenter defaultCenter] postNotificationName:@"CHANGECUSTOMERNAME" object:model.name];
}
......@@ -364,8 +356,8 @@
#pragma mark -设置为当前用户请求、写入访问时间
- (void)SetupUserRequest
{
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@%@",ServerAddress,@"/consumer/saveLastVisitedTime?consumerId=",[Customermanager manager].customerID] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
MyclientEntityModel *model = [Customermanager manager].model;
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@%@",ServerAddress,@"/consumer/saveLastVisitedTime?consumerId=",model.fid] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) {
NSLog(@"写入客户访问时间成功");
......@@ -408,12 +400,7 @@
self.companyNameField.enabled = YES;
self.changePersonInformationButton.hidden = YES;
[Shoppersmanager manager].currentCustomer = NO;
[Customermanager manager].customerID = nil;
[Customermanager manager].customerName = nil;
[Customermanager manager].customerPhoneNumber = nil;
[Customermanager manager].companyName = nil;
[Customermanager manager].cutomerAddress = nil;
[Customermanager manager].header = nil;
[Customermanager manager].model = nil;
self.customerHeader.image = TCImage(@"now");
[self.changePersonInformationButton setTitle:@"更改客户信息" forState:UIControlStateNormal];
[self ChangeCustomerName];
......@@ -450,17 +437,17 @@
[self ErrorMBProgressView:@"手机号码格式不正确"];
return;
}
//客户信息类
TOConsumerEntity *customerEntity = [[TOConsumerEntity alloc]init];
MyclientEntityModel *customerEntity = [[MyclientEntityModel alloc]init];
customerEntity.createName = [Shoppersmanager manager].Shoppers.employee.realName;
customerEntity.mobile = self.phoneNumberField.text;
customerEntity.address = self.customerAddress.text;
customerEntity.name = self.customerNameField.text;
customerEntity.company = self.companyNameField.text;
customerEntity.picture = [Customermanager manager].model.picture;
//修改
if (isChange) {
customerEntity.fid = [Customermanager manager].customerID;
customerEntity.fid = [Customermanager manager].model.fid;
}
[self CreateMBProgressHUDLoding];
......@@ -473,7 +460,7 @@
[self.informationTableview.mj_header beginRefreshing];
//新增保存ID
if (!isChange) {
[Customermanager manager].customerID = returnValue[@"data"];
[Customermanager manager].model.fid = returnValue[@"data"];
[self SuccessMBProgressView:@"新增成功"];
}else
{
......@@ -481,10 +468,7 @@
[self.changePersonInformationButton setTitle:@"更改客户信息" forState:UIControlStateNormal];
}
//保存客户信息
[Customermanager manager].customerName = customerEntity.name;
[Customermanager manager].customerPhoneNumber = customerEntity.mobile;
[Customermanager manager].companyName = customerEntity.company;
[Customermanager manager].cutomerAddress = customerEntity.address;
[Customermanager manager].model = customerEntity;
[Shoppersmanager manager].currentCustomer = YES;
[self.addpersonInformationButton setTitle:@"退出当前客户" forState:UIControlStateNormal];
self.changePersonInformationButton.hidden = NO;
......@@ -520,7 +504,7 @@
- (void)addAddressInformationRequest
{
TOShippingAddrEntity *address = [[TOShippingAddrEntity alloc]init];
address.consumerId = [Customermanager manager].customerID;
address.consumerId = [Customermanager manager].model.fid;
address.name = self.customerNameField.text;
address.miblephone = self.phoneNumberField.text;
address.address = self.customerAddress.text;
......
......@@ -222,6 +222,8 @@
SceneLibraryViewController *sceneVC = [SHARED_APPDELEGATE.allControllerArray objectAtIndex_opple:5];
sceneVC.conditionModel.styleEquals = nil;
sceneVC.conditionModel.spaceEquals = nil;
[sceneVC.StyleButton setTitle:@"风格" forState:UIControlStateNormal];
[sceneVC.StyleButton setTitle:@"空间" forState:UIControlStateNormal];
[sceneVC.seceneLibararyCollectionView.mj_header beginRefreshing];
}else if ([Name isEqualToString:@"产品库"])
......
......@@ -14,11 +14,12 @@
[super awakeFromNib];
// Initialization code
[self.customerHeader sd_setImageWithURL:[NSURL URLWithString:[[Customermanager manager] header]] placeholderImage:REPLACEIMAGE];
self.customerName.text = [[Customermanager manager] customerName];
self.companyName.text = [[Customermanager manager] companyName];
self.companyLocation.text = [[Customermanager manager] cutomerAddress];
self.customerPhoneNumber.text = [[Customermanager manager] customerPhoneNumber];
MyclientEntityModel *model = [Customermanager manager].model;
[self.customerHeader sd_setImageWithURL:[NSURL URLWithString:model.picture] placeholderImage:REPLACEIMAGE];
self.customerName.text = [Customermanager manager].model.name;
self.companyName.text = [Customermanager manager].model.company;
self.companyLocation.text = [Customermanager manager].model.address;
self.customerPhoneNumber.text = [Customermanager manager].model.mobile;
}
......
......@@ -399,7 +399,7 @@
}
[self StartAddShoppingCarAnimationWithimage:self.headerView.goodsImageview.image withStartpoint:[self.headerView convertPoint:[self.headerView.goodsImageview center] toView:self.view.window] withSize:self.headerView.goodsImageview.frame.size];
SaveShoppingCartRequest *shopCar = [[SaveShoppingCartRequest alloc]init];
shopCar.consumerId = [[Customermanager manager] customerID];
shopCar.consumerId = [Customermanager manager].model.fid;
shopCar.goodsId = _goodsID;
shopCar.count = self.headerView.goodsNumber.text;
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/shopcart/save"] WithRequestType:0 WithParameter:shopCar WithReturnValueBlock:^(id returnValue) {
......
......@@ -751,7 +751,7 @@
{
SaveShoppingCartRequest *shopCar = [[SaveShoppingCartRequest alloc]init];
shopCar.consumerId = [[Customermanager manager] customerID];
shopCar.consumerId = [Customermanager manager].model.fid;
shopCar.goodsId = model.fid;
shopCar.count = @"1";
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/shopcart/save"] WithRequestType:0 WithParameter:shopCar WithReturnValueBlock:^(id returnValue) {
......
......@@ -9,7 +9,7 @@
#import "SceneLibraryViewController.h"
#import "SeceneLibraryCollectionViewCell.h"
#import "FullScreenViewController.h"
@interface SceneLibraryViewController ()<UICollectionViewDelegate,UICollectionViewDataSource,ReturnTableviewcellIndexpathdelegate>
@interface SceneLibraryViewController ()<UICollectionViewDelegate,UICollectionViewDataSource,ReturnTableviewcellIndexpathdelegate,DZNEmptyDataSetSource>
......@@ -190,6 +190,7 @@
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/scene/query"] WithRequestType:0 WithParameter:condition WithReturnValueBlock:^(id returnValue) {
self.seceneLibararyCollectionView.emptyDataSetSource = self;
[self endRefreshingForTableView:self.seceneLibararyCollectionView];
[self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
......@@ -346,7 +347,19 @@
[self dismissViewControllerAnimated:YES completion:nil];
self.seceneLibraryCollectionLayout.itemSize = CGSizeMake((ScreenWidth-showcellNumber*2)/showcellNumber, (ScreenWidth-showcellNumber*2)/showcellNumber-50);
[self.seceneLibararyCollectionView reloadData];
}
#pragma mark -友好界面
- (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView
{
return TCImage(@"圆角矩形-3-副本");
}
- (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView
{
return [[NSAttributedString alloc]initWithString:@"暂无数据" attributes:nil];
}
......
......@@ -220,7 +220,7 @@
return;
}
SaveShoppingCartRequest *shopCar = [[SaveShoppingCartRequest alloc]init];
shopCar.consumerId = [[Customermanager manager] customerID];
shopCar.consumerId = [Customermanager manager].model.fid;
shopCar.goodsId =@"";
shopCar.count = @"";
for (int i=0; i<self.shoppingTableView.visibleCells.count; i++) {
......
......@@ -166,7 +166,7 @@
- (void)addAddressInformationRequest
{
TOShippingAddrEntity *address = [[TOShippingAddrEntity alloc]init];
address.consumerId = [Customermanager manager].customerID;
address.consumerId = [Customermanager manager].model.fid;
address.name = self.recipientPerson.text;
address.miblephone = self.PhoneNumber.text;
address.city = [self.citySelected currentTitle];
......@@ -186,7 +186,7 @@
model.miblephone = self.PhoneNumber.text;
model.city = self.citySelected.currentTitle;
model.address = self.detailsAddress.text;
model.consumerId = [Customermanager manager].customerID;
model.consumerId = [Customermanager manager].model.fid;
model.fid = returnValue[@"data"];
model.isSelected = NO;
//增加地址
......@@ -241,7 +241,7 @@
{
TOShippingAddrEntity *address = [[TOShippingAddrEntity alloc]init];
address.consumerId = [Customermanager manager].customerID;
address.consumerId = [Customermanager manager].model.fid;
address.name = self.recipientPerson.text;
address.miblephone = self.PhoneNumber.text;
address.city = [self.citySelected currentTitle];
......@@ -262,7 +262,7 @@
model.miblephone = self.PhoneNumber.text;
model.city = self.citySelected.currentTitle;
model.address = self.detailsAddress.text;
model.consumerId = [Customermanager manager].customerID;
model.consumerId = [Customermanager manager].model.fid;
model.fid = returnValue[@"data"];
model.isSelected = NO;
//修改地址
......
......@@ -110,7 +110,7 @@
- (void)getAddressDatasRequest
{
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@%@",ServerAddress,@"/shippingAddress/listAddress/",[Customermanager manager].customerID] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@%@",ServerAddress,@"/shippingAddress/listAddress/",[Customermanager manager].model.fid] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
......@@ -381,7 +381,7 @@
orderReceiver.receiverAddress = model.address;
order.order = orderReceiver;
orderReceiver.guideId = [[Shoppersmanager manager] Shoppers].employee.fid;
orderReceiver.consumerId = [[Customermanager manager] customerID];
orderReceiver.consumerId = [Customermanager manager].model.fid;
orderReceiver.orderState = @"001";
//商品ID
NSArray *goodArray = [self.datasArray lastObject];
......
......@@ -109,7 +109,7 @@
return;
}
ShopCartFilter *shopcarNumber = [[ShopCartFilter alloc]init];
shopcarNumber.consumerId = [Customermanager manager].customerID;
shopcarNumber.consumerId = [Customermanager manager].model.fid;
DataPage *Newpage = [[DataPage alloc]init];
Newpage.page = 1;
Newpage.rows = 99999;
......
......@@ -82,12 +82,7 @@
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[Shoppersmanager manager].currentCustomer = NO;
[Customermanager manager].customerID = nil;
[Customermanager manager].customerName = nil;
[Customermanager manager].customerPhoneNumber = nil;
[Customermanager manager].companyName = nil;
[Customermanager manager].cutomerAddress = nil;
[Customermanager manager].header = nil;
[Customermanager manager].model = nil;
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
LoginViewController *loginVC = [storyboard instantiateViewControllerWithIdentifier:@"Login"];
[[NSUserDefaults standardUserDefaults] removeObjectForKey:USERNAME];
......
......@@ -61,6 +61,7 @@
29360C311CDDC487002A5D89 /* ScreeningView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29360C301CDDC487002A5D89 /* ScreeningView.xib */; };
2936F28C1D014147007CA67C /* sceneScreeningCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2936F28B1D014147007CA67C /* sceneScreeningCollectionViewCell.m */; };
2936F28F1D0141FD007CA67C /* ProductScreeningTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2936F28E1D0141FD007CA67C /* ProductScreeningTableViewCell.m */; };
2936F2931D016EB2007CA67C /* SceneSelectedModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 2936F2921D016EB2007CA67C /* SceneSelectedModel.m */; };
2942F8A61CDD80C2005B377E /* authenticateView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2942F8A51CDD80C2005B377E /* authenticateView.m */; };
2942F8A81CDD80CE005B377E /* authenticateView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2942F8A71CDD80CE005B377E /* authenticateView.xib */; };
2949BABD1CD2EFA00049385A /* InformationTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2949BABC1CD2EFA00049385A /* InformationTableViewCell.m */; };
......@@ -262,6 +263,8 @@
2936F28B1D014147007CA67C /* sceneScreeningCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = sceneScreeningCollectionViewCell.m; sourceTree = "<group>"; };
2936F28D1D0141FD007CA67C /* ProductScreeningTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProductScreeningTableViewCell.h; sourceTree = "<group>"; };
2936F28E1D0141FD007CA67C /* ProductScreeningTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProductScreeningTableViewCell.m; sourceTree = "<group>"; };
2936F2911D016EB2007CA67C /* SceneSelectedModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SceneSelectedModel.h; sourceTree = "<group>"; };
2936F2921D016EB2007CA67C /* SceneSelectedModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SceneSelectedModel.m; sourceTree = "<group>"; };
2942F8A41CDD80C2005B377E /* authenticateView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = authenticateView.h; sourceTree = "<group>"; };
2942F8A51CDD80C2005B377E /* authenticateView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = authenticateView.m; sourceTree = "<group>"; };
2942F8A71CDD80CE005B377E /* authenticateView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = authenticateView.xib; sourceTree = "<group>"; };
......@@ -800,6 +803,15 @@
name = view;
sourceTree = "<group>";
};
2936F2901D016E91007CA67C /* model */ = {
isa = PBXGroup;
children = (
2936F2911D016EB2007CA67C /* SceneSelectedModel.h */,
2936F2921D016EB2007CA67C /* SceneSelectedModel.m */,
);
name = model;
sourceTree = "<group>";
};
2942F8A21CDD7ECD005B377E /* controller */ = {
isa = PBXGroup;
children = (
......@@ -965,6 +977,7 @@
29808A611CFEC287001D1020 /* Experiencecentre */ = {
isa = PBXGroup;
children = (
2936F2901D016E91007CA67C /* model */,
2936F2861D014094007CA67C /* view */,
29808A681CFED712001D1020 /* Controller */,
29808A651CFED6E5001D1020 /* Scene */,
......@@ -1713,6 +1726,7 @@
29BB277D1CD9DFCB009A0813 /* CustomerManagementViewController.m in Sources */,
2962D06D1CD1A43A0058829D /* ClientViewController.m in Sources */,
29A8D3981CD85A58004D558F /* ClientdetailsViewController.m in Sources */,
2936F2931D016EB2007CA67C /* SceneSelectedModel.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
......@@ -423,7 +423,7 @@
#pragma mark -查询购物车数量
- (void)QueryShoppingCarNumber
{
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@%@",ServerAddress,@"/shopcart/get/",[Customermanager manager].customerID] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@%@",ServerAddress,@"/shopcart/get/",[Customermanager manager].model.fid] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) {
......
......@@ -7,7 +7,7 @@
//
#import <Foundation/Foundation.h>
#import "MyclientEntityModel.h"
@interface Customermanager : NSObject
......@@ -19,34 +19,40 @@
+ (Customermanager *)manager;
/**
* 客户iD
*/
@property (nonatomic,copy) NSString *customerID;
/**
* 客户姓名
*/
@property (nonatomic,copy) NSString *customerName;
/**
* 客户手机号码
*/
@property (nonatomic,copy) NSString *customerPhoneNumber;
/**
* 客户公司名字
*/
@property (nonatomic,copy) NSString *companyName;
///**
// * 客户iD
// */
//@property (nonatomic,copy) NSString *customerID;
//
///**
// * 客户姓名
// */
//@property (nonatomic,copy) NSString *customerName;
//
///**
// * 客户手机号码
// */
//@property (nonatomic,copy) NSString *customerPhoneNumber;
//
///**
// * 客户公司名字
// */
//@property (nonatomic,copy) NSString *companyName;
//
///**
// * 客户地址
// */
//@property (nonatomic,copy) NSString *cutomerAddress;
//
///**
// * header
// */
//@property (nonatomic,copy) NSString *header;
/**
* 客户地址
* 用户信息模型
*/
@property (nonatomic,copy) NSString *cutomerAddress;
@property (nonatomic,strong) MyclientEntityModel *model;
/**
* header
*/
@property (nonatomic,copy) NSString *header;
@end
//
// SceneSelectedModel.h
// Lighting
//
// Created by 曹云霄 on 16/6/3.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <JSONModel/JSONModel.h>
@interface SceneSelectedModel : JSONModel
/**
* 图片
*/
@property (nonatomic,strong) UIImage *sceneImage;
/**
* 选中状态
*/
@property (nonatomic,assign) BOOL isSelectedState;
@end
//
// SceneSelectedModel.m
// Lighting
//
// Created by 曹云霄 on 16/6/3.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "SceneSelectedModel.h"
@implementation SceneSelectedModel
@end
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