Commit d7b136f4 authored by 勾芒's avatar 勾芒

曹云霄

parent ebd70446
......@@ -22,15 +22,15 @@
{
_goodsAllprice = goodsAllprice;
NSUInteger allNumber;
NSInteger allPrice;
NSUInteger allNumber = 0;
NSInteger allPrice = 0;
for (ShopcarModel *model in _goodsAllprice) {
allNumber += model.goodsNum;
allPrice += [model.goods.costPrice integerValue];
}
self.goodsAllNumber.text = [NSString stringWithFormat:@"%ld",allNumber];
self.goodsAllPrice.text = [NSString stringWithFormat:@"%ld",allPrice];
self.goodsAllPrice.text = [NSString stringWithFormat:@"%ld",allPrice*allNumber];
}
......
......@@ -136,11 +136,11 @@
self.searchPersonInformationField.delegate = self;
//监听键盘落下的通知
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(KeyboadrDismiss) name:UIKeyboardWillHideNotification object:nil];
}
#pragma mark -获取导购关联客户
- (void)getShoppersAssociatedCustomer:(ConsumerQueryCondition *)condition isRemoveArray:(BOOL)remove
{
......@@ -267,13 +267,18 @@
[Customermanager manager].customerID = model.fid;
[Customermanager manager].customerName = model.name;
[Customermanager manager].customerPhoneNumber = model.mobile;
[Customermanager manager].companyAddress = model.address;
[Customermanager manager].companyName = model.address;
[Customermanager manager].cutomerAddress = model.address;
[self.addpersonInformationButton setTitle:@"退出当前客户" forState:UIControlStateNormal];
self.changePersonInformationButton.hidden = NO;
[self SetupUserShoppingCarNumberRequest];
[self SetupUserRequest];
[self ChangeCustomerName];
self.customerNameField.enabled = NO;
self.customerAddress.enabled = NO;
self.phoneNumberField.enabled = NO;
self.companyNameField.enabled = NO;
}
......@@ -311,13 +316,11 @@
}
#pragma mark -添加客户信息、或者退出当前客户
- (IBAction)addCustomerInformationORExit:(UIButton *)sender {
if ([sender.currentTitle isEqualToString:@"退出当前客户"]) {
[[NSNotificationCenter defaultCenter]postNotificationName:REFRESHSHOPPINGCAR object:@(0)];
self.customerNameField.text = nil;
self.customerAddress.text = nil;
self.phoneNumberField.text = nil;
......@@ -329,8 +332,13 @@
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;
[self.changePersonInformationButton setTitle:@"更改客户信息" forState:UIControlStateNormal];
[self ChangeCustomerName];
[self QueryShoppingCarNumber];
//全部为为选中状态
for (InformationTableViewCell *cell in self.informationTableview.visibleCells) {
......@@ -344,6 +352,7 @@
return;
}
[self addCustomerInformation:NO];
}
......@@ -386,6 +395,8 @@
[self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
//进入刷新状态
[self.informationTableview.mj_header beginRefreshing];
//新增保存ID
if (!isChange) {
[Customermanager manager].customerID = returnValue[@"data"];
......@@ -398,7 +409,7 @@
//保存客户信息
[Customermanager manager].customerName = customerEntity.name;
[Customermanager manager].customerPhoneNumber = customerEntity.mobile;
[Customermanager manager].companyAddress = customerEntity.address;
[Customermanager manager].companyName = customerEntity.address;
[Customermanager manager].cutomerAddress = customerEntity.address;
[Shoppersmanager manager].currentCustomer = YES;
[self.addpersonInformationButton setTitle:@"退出当前客户" forState:UIControlStateNormal];
......@@ -504,7 +515,7 @@
#pragma mark -键盘落下,判断更改信息按钮是否可见,可见则取消输入框的响应
- (void)KeyboadrDismiss
{
if (!self.changePersonInformationButton.selected) {
if (!self.changePersonInformationButton.hidden) {
self.customerNameField.enabled = NO;
self.customerAddress.enabled = NO;
......
......@@ -21,10 +21,10 @@
_model = model;
[self.goodsHeader sd_setImageWithURL:[NSURL URLWithString:_model.goods.pictures] placeholderImage:ReplaceImage];
self.goodsName.text = _model.goods.name;
self.goodsNumber.text = [NSString stringWithFormat:@"数量 X%@",_model.goods.number];
self.goodsNumber.text = [NSString stringWithFormat:@"数量 X%d",_model.goodsNum];
self.clinchPrice.text = [NSString stringWithFormat:@"成交价 ¥%@",[_model.goods.costPrice stringValue]];
//计算总价格
NSInteger number = [_model.goods.number integerValue];
NSInteger number = _model.goodsNum;
NSInteger price = [_model.goods.costPrice integerValue];
NSInteger allPrice = number*price;
self.totalPrice.text = [NSString stringWithFormat:@"%ld",allPrice];
......
......@@ -288,7 +288,7 @@
break;
case 1:
{
return 135;
return 110;
}
break;
case 2:
......
......@@ -18,7 +18,7 @@
self.customerName.text = [Customermanager manager].customerName;
self.companyName.text = [Customermanager manager].customerName;
// self.emailName.text = [Customermanager manager]
self.companyLocation.text = [Customermanager manager].companyAddress;
self.companyLocation.text = [Customermanager manager].companyName;
self.customerPhoneNumber.text = [Customermanager manager].customerPhoneNumber;
}
......
......@@ -16,6 +16,17 @@
* 城市选择器
*/
@property (nonatomic,strong) ModifyShippingAddressView *citySelecteview;
/**
* 选中省
*/
@property (nonatomic,copy) NSString *provincesString;
/**
* 选中城市
*/
@property (nonatomic,copy) NSString *cityString;
@end
@implementation AddressViewController
......@@ -123,13 +134,15 @@
#pragma mark 完成城市选择后
- (void)citySelected:(NSString *)cityString
- (void)citySelected:(NSString *)cityString WithprovincesString:(NSString *)provincesString
{
self.cityString = cityString;
self.provincesString = provincesString;
[self.citySelected setTitle:cityString forState:UIControlStateNormal];
}
#pragma mark 新增按钮点击,或者修改
#pragma mark 新增按钮点击,或者保存
- (IBAction)addAddressButtonClick:(UIButton *)sender {
if ([sender.currentTitle isEqualToString:@"新增"]) {
......@@ -140,11 +153,9 @@
{
[self ChangeAddressInformationRequest];
}
}
#pragma mark -新增地址信息
- (void)addAddressInformationRequest
{
......@@ -153,6 +164,7 @@
address.name = self.recipientPerson.text;
address.miblephone = self.PhoneNumber.text;
address.city = [self.citySelected currentTitle];
address.province = self.provincesString;
address.address = self.detailsAddress.text;
[self CreateMBProgressHUDLoding];
......
......@@ -210,7 +210,7 @@
switch (indexPath.section) {
case 0:
{
return 140;
return 110;
}
break;
case 1:
......
......@@ -12,7 +12,7 @@
@protocol CityselectedDelegate <NSObject>
//城市选择
- (void)citySelected:(NSString *)cityString;
- (void)citySelected:(NSString *)cityString WithprovincesString:(NSString *)provincesString;
@end
......
......@@ -114,8 +114,8 @@
break;
}
if ([self.delegate respondsToSelector:@selector(citySelected:)]) {
[self.delegate citySelected:cityString];
if ([self.delegate respondsToSelector:@selector(citySelected:WithprovincesString:)]) {
[self.delegate citySelected:cityString WithprovincesString:provincesString];
}
}
......
......@@ -36,7 +36,7 @@
self.tagsPriceLabe.text = [_model.goods.tagPrice stringValue];
self.clinchTextfield.text = [_model.goods.costPrice stringValue];
self.goodsNumbersLabe.text = [NSString stringWithFormat:@"%d",_model.goodsNum];
self.productPriceLabe.text = [_model.goods.costPrice stringValue];
self.productPriceLabe.text = [NSString stringWithFormat:@"¥%ld",[self.goodsNumbersLabe.text integerValue]*[_model.goods.costPrice integerValue]];;
}
#pragma mark -增加或者减少商品
......
......@@ -11,6 +11,7 @@
#import "AppDelegate.h"
#import "GenerateOrdersViewController.h"
#import "ShopcarModel.h"
#import "AddressModel.h"
@interface ShoppingViewController ()<UITableViewDelegate,UITableViewDataSource,ChangeGoodsNumberDelegate>
......@@ -227,9 +228,11 @@
[self ErrorMBProgressView:@"没有选中任何商品"];
return;
}
//占位
ShopcarModel *ZhanweiModel = [[ShopcarModel alloc]init];
//商品总信息占位
ShopcarModel*ZhanweiModel = [[ShopcarModel alloc]init];
[array addObject:ZhanweiModel];
GenerateOrdersViewController *generateOrder = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"generateorders"];
generateOrder.settlementGoodsdatas = array;
//清除已经生成订单的商品
......
......@@ -35,9 +35,9 @@
@property (nonatomic,copy) NSString *customerPhoneNumber;
/**
* 客户公司地址
* 客户公司名字
*/
@property (nonatomic,copy) NSString *companyAddress;
@property (nonatomic,copy) NSString *companyName;
/**
* 客户地址
......
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