Commit 5fd771a7 authored by 曹云霄's avatar 曹云霄

debug

parent bfca1600
......@@ -601,7 +601,8 @@
[self.informationTableview.mj_header beginRefreshing];
//新增保存ID
if (!isChange) {
[Customermanager manager].model.fid = returnValue[@"data"];
customerEntity.fid = returnValue[@"data"];
[Customermanager manager].model = customerEntity;
[self SuccessMBProgressView:@"新增成功"];
[self addAddressInformationRequest];
}else
......@@ -645,7 +646,8 @@
- (void)addAddressInformationRequest
{
TOShippingAddrEntity *address = [[TOShippingAddrEntity alloc]init];
address.consumerId = [Customermanager manager].model.fid;
MyclientEntityModel *model = [Customermanager manager].model;
address.consumerId = model.fid;
address.name = self.customerNameField.text;
address.miblephone = self.phoneNumberField.text;
address.address = self.customerAddress.text;
......
......@@ -312,7 +312,8 @@
}
[self CreateMBProgressHUDLoding];
//发送验证码
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(SENDSMS),inputPhoneNumber,self.identityView.userName.text] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
NSString *urlString = [NSString stringWithFormat:SERVERREQUESTURL(SENDSMS),inputPhoneNumber,self.identityView.userName.text];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:urlString WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
......
......@@ -448,7 +448,6 @@
#pragma mark -完成加入购物车动画完成后回调
- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag
{
NSLog(@"动画完成了");
[[NSNotificationCenter defaultCenter]postNotificationName:@"ADDGOODSNUMBER" object:@([self.headerView.goodsNumber.text integerValue])];
}
......@@ -462,6 +461,10 @@
[self ErrorMBProgressView:@"必须设置当前客户"];
return;
}
if ([self.headerView.goodsNumber.text integerValue] > [self.entity.number integerValue]) {
[self ErrorMBProgressView:@"超过库存"];
return;
}
[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].model.fid;
......
......@@ -73,11 +73,13 @@
[self.citySelected addTarget:self action:@selector(SelectedCityButtonClick) forControlEvents:UIControlEventTouchUpInside];
//判断是修改还是新增
if (_isChange) {
self.changAddressLabe.text = @"修改收货地址";
[self.delectAddressButton setTitle:@"删除" forState:UIControlStateNormal];
[self.modifyButton setTitle:@"保存" forState:UIControlStateNormal];
}else
{
self.changAddressLabe.text = @"新增收货地址";
}
self.recipientPerson.text = _model.name;
self.PhoneNumber.text = _model.miblephone;
[self.citySelected setTitle:_model.city forState:UIControlStateNormal];
......@@ -90,8 +92,6 @@
self.view.superview.layer.cornerRadius = 0;
}
#pragma mark -城市选择器
- (void)SelectedCityButtonClick
{
......@@ -125,7 +125,6 @@
}
#pragma mark -关闭地址输入框
- (IBAction)turnoffAddressView:(UIButton *)sender {
......@@ -146,6 +145,10 @@
- (IBAction)addAddressButtonClick:(UIButton *)sender {
NSString *phoneNumber = self.PhoneNumber.text;
if (!self.recipientPerson.text.length) {
[self ErrorMBProgressView:@"请输入收货人姓名"];
return;
}
if (phoneNumber.length <= 0) {
[self ErrorMBProgressView:@"手机号码不能为空"];
return;
......@@ -155,10 +158,6 @@
[self ErrorMBProgressView:@"手机号码格式不正确"];
return;
}
if (!self.recipientPerson.text.length) {
[self ErrorMBProgressView:@"请输入收货人姓名"];
return;
}
if (!self.detailsAddress.text.length) {
[self ErrorMBProgressView:@"请输入详细地址"];
return;
......@@ -186,7 +185,6 @@
address.province = self.provincesString;
}
address.address = self.detailsAddress.text;
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(ADDADDRESS) WithRequestType:0 WithParameter:address WithReturnValueBlock:^(id returnValue) {
......@@ -196,14 +194,15 @@
AddressModel *model = [[AddressModel alloc]init];
model.name = self.recipientPerson.text;
model.miblephone = self.PhoneNumber.text;
model.city = self.citySelected.currentTitle;
//地址拼接
if (![self.provincesString isEqualToString:[self.citySelected currentTitle]]) {
model.address = [NSString stringWithFormat:@"%@%@%@",self.provincesString,self.citySelected.currentTitle,self.detailsAddress.text];
if ([[self.citySelected currentTitle] isEqualToString:self.provincesString]) {
model.city = self.citySelected.currentTitle;
model.province = nil;
}else
{
model.address = [NSString stringWithFormat:@"%@%@",self.citySelected.currentTitle,self.detailsAddress.text];
model.city = self.citySelected.currentTitle;
model.province = self.provincesString;
}
model.address = self.detailsAddress.text;
model.consumerId = [Customermanager manager].model.fid;
model.fid = returnValue[@"data"];
model.isSelected = NO;
......@@ -253,10 +252,17 @@
model.name = self.recipientPerson.text;
model.miblephone = self.PhoneNumber.text;
model.city = self.citySelected.currentTitle;
model.address = self.detailsAddress.text;
model.consumerId = [Customermanager manager].model.fid;
model.province = self.provincesString?self.provincesString:@"";
model.fid = self.model.fid;
model.isSelected = NO;
//地址拼接
if (![self.provincesString isEqualToString:[self.citySelected currentTitle]]) {
model.address = [NSString stringWithFormat:@"%@",self.detailsAddress.text];
}else
{
model.address = [NSString stringWithFormat:@"%@",self.detailsAddress.text];
}
//修改地址
if ([self.delegate respondsToSelector:@selector(ChangeAddresscell:Withcellindex:)]) {
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
......
......@@ -24,7 +24,17 @@
self.isSelectedButton.selected = NewModel.isSelected;
self.consigneeName.text = _NewModel.name;
self.consigneemobile.text = _NewModel.miblephone;
self.consigneeAddress.text = _NewModel.address;
if (_NewModel.province && _NewModel.city) {
if (![_NewModel.province isEqualToString:_NewModel.city]) {
self.consigneeAddress.text = [NSString stringWithFormat:@"%@%@%@",_NewModel.province,_NewModel.city,_NewModel.address];
}else
{
self.consigneeAddress.text = [NSString stringWithFormat:@"%@%@",_NewModel.city,_NewModel.address];
}
}else
{
self.consigneeAddress.text = [NSString stringWithFormat:@"%@",_NewModel.address];
}
}
......
......@@ -199,7 +199,6 @@
}
else if (indexPath.section == 2)
{
NSArray *Addressarr = [self.datasArray objectAtIndex_opple:indexPath.section];
if (indexPath.row == Addressarr.count-1) {
......
......@@ -115,6 +115,9 @@
//更改用户名
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ChangeCustomerName:) name:@"CHANGECUSTOMERNAME" object:nil];
//更改导购名
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ChangeShoppersName:) name:@"CHANGESHOPPERSNAME" object:nil];
}
......@@ -142,6 +145,17 @@
[button setTitle:userName forState:UIControlStateNormal];
}
#pragma mark -更改导购名字
- (void)ChangeShoppersName:(NSNotification *)not
{
UIButton *button = [self viewWithTag:101];
NSString *userName = not.object;
if (userName.length == 0 || !userName) {
userName = @"导购";
}
[button setTitle:userName forState:UIControlStateNormal];
}
#pragma mark -二维码扫描码
- (void)QrCodeButtonClickAction
......
......@@ -63,7 +63,7 @@
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(SHOPPERSCOMMISSION),[Shoppersmanager manager].Shoppers.employee.fid] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) {
self.rebateLabe.text = [NSString stringWithFormat:@"¥%@",returnValue[@"data"]];
self.rebateLabe.text = [NSString stringWithFormat:@"¥%.2f",[returnValue[@"data"] floatValue]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) {
......@@ -297,7 +297,8 @@
[Shoppersmanager manager].passWordString = self.passWord.text;
[Shoppersmanager manager].currentCustomer = NO;
[Shoppersmanager manager].Shoppers = result;
[[NSNotificationCenter defaultCenter] postNotificationName:@"CHANGESHOPPERSNAME" object:result.employee.realName];
[[NSNotificationCenter defaultCenter] postNotificationName:@"CHANGECUSTOMERNAME" object:nil];
//保存用户名密码
[[NSUserDefaults standardUserDefaults] setObject:self.userName.text forKey:USERNAME];
[[NSUserDefaults standardUserDefaults] setObject:self.passWord.text forKey:PASSWORD];
......
......@@ -110,12 +110,12 @@
/**
* 服务器开发地址
*/
//#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://139.196.195.30:8090/opple-web/app%@",URL]
#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://139.196.195.30:8090/opple-web/app%@",URL]
/**
* 服务器测试地址
*/
#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg-dev.opple.com/opple-web/app%@",URL]
//#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg-dev.opple.com/opple-web/app%@",URL]
/**
* 搜索框输入通知
......
......@@ -233,7 +233,7 @@
return _backBtn;
}
#pragma mark -设置扫描范围
-(QRView *)qrView {
if (!_qrView) {
......
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