Commit 03ed62ea authored by 曹云霄's avatar 曹云霄

修复客户基于IOS10 的bug

parent be69cb93
...@@ -441,7 +441,7 @@ ...@@ -441,7 +441,7 @@
} WithprogressBlock:^(double progress) { } WithprogressBlock:^(double progress) {
if (progress >= 1) { if (progress >= 1) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
weskSelf.TCHud.label.text = @"上传完成"; weskSelf.TCHud.labelText = @"上传完成";
[weskSelf RemoveMBProgressHUDLoding]; [weskSelf RemoveMBProgressHUDLoding];
}); });
}else }else
...@@ -452,12 +452,12 @@ ...@@ -452,12 +452,12 @@
} }
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
weskSelf.TCHud.label.text = @"上传失败"; weskSelf.TCHud.labelText = @"上传失败";
[weskSelf RemoveMBProgressHUDLoding]; [weskSelf RemoveMBProgressHUDLoding];
}); });
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
weskSelf.TCHud.label.text = @"上传失败"; weskSelf.TCHud.labelText = @"上传失败";
[weskSelf RemoveMBProgressHUDLoding]; [weskSelf RemoveMBProgressHUDLoding];
}); });
}]; }];
...@@ -597,7 +597,6 @@ ...@@ -597,7 +597,6 @@
[self ErrorMBProgressView:@"地址不能为空"]; [self ErrorMBProgressView:@"地址不能为空"];
return; return;
} }
//客户信息类 //客户信息类
MyclientEntityModel *customerEntity = [[MyclientEntityModel alloc]init]; MyclientEntityModel *customerEntity = [[MyclientEntityModel alloc]init];
customerEntity.createName = [Shoppersmanager manager].Shoppers.employee.realName; customerEntity.createName = [Shoppersmanager manager].Shoppers.employee.realName;
...@@ -610,53 +609,51 @@ ...@@ -610,53 +609,51 @@
if (isChange) { if (isChange) {
customerEntity.fid = [Customermanager manager].model.fid; customerEntity.fid = [Customermanager manager].model.fid;
} }
__weak typeof(self) weskSelf = self; WS(weakSelf);
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(ADDCONSUMER) WithRequestType:0 WithParameter:customerEntity WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(ADDCONSUMER) WithRequestType:0 WithParameter:customerEntity WithReturnValueBlock:^(id returnValue) {
[weskSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
//进入刷新状态 //进入刷新状态
[weskSelf.informationTableview.mj_header beginRefreshing]; [weakSelf.informationTableview.mj_header beginRefreshing];
//新增保存ID //新增保存ID
if (!isChange) { if (!isChange) {
customerEntity.fid = returnValue[@"data"]; customerEntity.fid = returnValue[@"data"];
[Customermanager manager].model = customerEntity; [Customermanager manager].model = customerEntity;
[weskSelf SuccessMBProgressView:@"新增成功"]; [weakSelf SuccessMBProgressView:@"新增成功"];
[weskSelf addAddressInformationRequest]; [weakSelf addAddressInformationRequest];
}else }else
{ {
[weskSelf SuccessMBProgressView:@"修改成功"]; [weakSelf SuccessMBProgressView:@"修改成功"];
[weskSelf.changePersonInformationButton setTitle:@"更改客户信息" forState:UIControlStateNormal]; [weakSelf.changePersonInformationButton setTitle:@"更改客户信息" forState:UIControlStateNormal];
} }
//保存客户信息 //保存客户信息
[Customermanager manager].model = customerEntity; [Customermanager manager].model = customerEntity;
[Shoppersmanager manager].currentCustomer = YES; [Shoppersmanager manager].currentCustomer = YES;
[weskSelf.addpersonInformationButton setTitle:@"退出当前客户" forState:UIControlStateNormal]; [weakSelf.addpersonInformationButton setTitle:@"退出当前客户" forState:UIControlStateNormal];
weskSelf.changePersonInformationButton.hidden = NO; weakSelf.changePersonInformationButton.hidden = NO;
weskSelf.customerNameField.enabled = NO; weakSelf.customerNameField.enabled = NO;
weskSelf.customerAddress.enabled = NO; weakSelf.customerAddress.enabled = NO;
weskSelf.phoneNumberField.enabled = NO; weakSelf.phoneNumberField.enabled = NO;
weskSelf.companyNameField.enabled = NO; weakSelf.companyNameField.enabled = NO;
[weskSelf SetupUserShoppingCarNumberRequest]; [weakSelf SetupUserShoppingCarNumberRequest];
[weskSelf SetupUserRequest]; [weakSelf SetupUserRequest];
[weskSelf ChangeCustomerName]; [weakSelf ChangeCustomerName];
} }
else else
{ {
[weskSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
[weskSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weskSelf promptCustomerWithString:@"网络连接已断开"]; [weakSelf promptCustomerWithString:@"网络连接已断开"];
} WithFailureBlock:^(id error) { } WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding];
[weskSelf RemoveMBProgressHUDLoding];
}]; }];
} }
...@@ -695,10 +692,7 @@ ...@@ -695,10 +692,7 @@
#pragma mark -更改客户信息 #pragma mark -更改客户信息
- (IBAction)changeCustomerInformation:(UIButton *)sender { - (IBAction)changeCustomerInformation:(UIButton *)sender {
if ([sender.currentTitle isEqualToString:@"保存"]) { if ([sender.currentTitle isEqualToString:@"保存"]) {
[self.customerNameField resignFirstResponder]; [self.customerNameField resignFirstResponder];
[sender setTitle:@"更改客户信息" forState:UIControlStateNormal]; [sender setTitle:@"更改客户信息" forState:UIControlStateNormal];
[self addCustomerInformation:YES]; [self addCustomerInformation:YES];
...@@ -749,6 +743,10 @@ ...@@ -749,6 +743,10 @@
self.customerAddress.enabled = NO; self.customerAddress.enabled = NO;
self.phoneNumberField.enabled = NO; self.phoneNumberField.enabled = NO;
self.companyNameField.enabled = NO; self.companyNameField.enabled = NO;
self.customerNameField.text = [Customermanager manager].model.name;
self.customerAddress.text = [Customermanager manager].model.address;
self.phoneNumberField.text = [Customermanager manager].model.mobile;
self.companyNameField.text = [Customermanager manager].model.company;
[self.changePersonInformationButton setTitle:@"更改客户信息" forState:UIControlStateNormal]; [self.changePersonInformationButton setTitle:@"更改客户信息" forState:UIControlStateNormal];
} }
} }
......
...@@ -438,8 +438,10 @@ ...@@ -438,8 +438,10 @@
return; return;
} }
TOGoodsEntity *model = [weakSelf.datasArray objectAtIndex_opple:cellindex]; TOGoodsEntity *model = [weakSelf.datasArray objectAtIndex_opple:cellindex];
[weakSelf CreateMBProgressHUDLoding];
[weakSelf addGoodsShoppingbags:model complate:^{ [weakSelf addGoodsShoppingbags:model complate:^{
NSLog(@"加入购物车完成"); NSLog(@"加入购物车完成");
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf StartAddShoppingCarAnimationWithimage:weakCell.productImageView.image withStartpoint:centerPoint withSize:size]; [weakSelf StartAddShoppingCarAnimationWithimage:weakCell.productImageView.image withStartpoint:centerPoint withSize:size];
}]; }];
}]; }];
...@@ -672,13 +674,11 @@ ...@@ -672,13 +674,11 @@
condition.materialEqueals = materialCode; condition.materialEqueals = materialCode;
} }
if (![priceTitle isEqualToString:@"全部"]) { if (![priceTitle isEqualToString:@"全部"]) {
//价格字符串切割 //价格字符串切割
NSArray *spacrArray = [priceTitle componentsSeparatedByString:@"到"]; NSArray *spacrArray = [priceTitle componentsSeparatedByString:@"到"];
condition.startprice = [NSNumber numberWithInteger:[[spacrArray objectAtIndex_opple:0] integerValue]]; condition.startprice = [NSNumber numberWithInteger:[[spacrArray objectAtIndex_opple:0] integerValue]];
condition.endprice = [NSNumber numberWithInteger:[[spacrArray objectAtIndex_opple:1] integerValue]]; condition.endprice = [NSNumber numberWithInteger:[[spacrArray objectAtIndex_opple:1] integerValue]];
} }
self.condtionModel.styleEquals = condition.styleEquals; self.condtionModel.styleEquals = condition.styleEquals;
self.condtionModel.categoryEquals = condition.categoryEquals; self.condtionModel.categoryEquals = condition.categoryEquals;
self.condtionModel.spaceEquals = condition.spaceEquals; self.condtionModel.spaceEquals = condition.spaceEquals;
...@@ -686,12 +686,12 @@ ...@@ -686,12 +686,12 @@
self.condtionModel.startprice = condition.startprice; self.condtionModel.startprice = condition.startprice;
self.condtionModel.endprice = condition.endprice; self.condtionModel.endprice = condition.endprice;
self.selectedCode = nil;//清空单选 self.selectedCode = nil;//清空单选
__weak typeof (self) Weakself = self; WS(weakSelf);
[self getGoodsListdatas:condition returnResponse:^(GoodsResponse *response) { [self getGoodsListdatas:condition returnResponse:^(GoodsResponse *response) {
Weakself.screenSecondView.totalNumber = response.total; weakSelf.screenSecondView.totalNumber = response.total;
//临时保存 //临时保存
self.temporaryArray = response; weakSelf.temporaryArray = response;
}]; }];
} }
...@@ -739,25 +739,23 @@ ...@@ -739,25 +739,23 @@
#pragma mark -添加至购物车 #pragma mark -添加至购物车
- (void)addGoodsShoppingbags:(TOGoodsEntity *)model complate:(void(^)())response - (void)addGoodsShoppingbags:(TOGoodsEntity *)model complate:(void(^)())response
{ {
WS(weakSelf);
SaveShoppingCartRequest *shopCar = [[SaveShoppingCartRequest alloc]init]; SaveShoppingCartRequest *shopCar = [[SaveShoppingCartRequest alloc]init];
shopCar.consumerId = [Customermanager manager].model.fid; shopCar.consumerId = [Customermanager manager].model.fid;
shopCar.goodsId = model.fid; shopCar.goodsId = model.fid;
shopCar.count = @"1"; shopCar.count = @"1";
WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(ADDSHOPPINGBAG) WithRequestType:0 WithParameter:shopCar WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(ADDSHOPPINGBAG) WithRequestType:0 WithParameter:shopCar WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
response(); response();
}else }else
{ {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:NETWORK];
} WithFailureBlock:^(id error) { } WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:@"加入购物车失败"]; [weakSelf ErrorMBProgressView:@"加入购物车失败"];
}]; }];
} }
......
...@@ -62,7 +62,6 @@ ...@@ -62,7 +62,6 @@
return; return;
} }
goodsNumber --; goodsNumber --;
// self.goodsNumbersLabe.text = [NSString stringWithFormat:@"%ld",goodsNumber];
} }
break; break;
case 101://增加 case 101://增加
...@@ -75,7 +74,6 @@ ...@@ -75,7 +74,6 @@
return; return;
} }
goodsNumber ++; goodsNumber ++;
// self.goodsNumbersLabe.text = [NSString stringWithFormat:@"%ld",goodsNumber];
} }
break; break;
default: default:
...@@ -83,12 +81,12 @@ ...@@ -83,12 +81,12 @@
} }
//改变价格 //改变价格
WS(weakSelf); WS(weakSelf);
self.productPriceLabe.text = [NSString stringWithFormat:@"¥%.2f",[self.goodsNumbersLabe.text integerValue]*[self.clinchTextfield.text floatValue]];
if ([self.delegate respondsToSelector:@selector(ChangeGoodsNumber:WithcostPrice:Withcellindex:returnValue:)]) { if ([self.delegate respondsToSelector:@selector(ChangeGoodsNumber:WithcostPrice:Withcellindex:returnValue:)]) {
[self.delegate ChangeGoodsNumber:goodsNumber WithcostPrice:[self.clinchTextfield.text floatValue]Withcellindex:_cellindex returnValue:^(id value) { [self.delegate ChangeGoodsNumber:goodsNumber WithcostPrice:[self.clinchTextfield.text floatValue]Withcellindex:_cellindex returnValue:^(id value) {
if ([value isKindOfClass:[NSDictionary class]]) { if ([value isKindOfClass:[NSDictionary class]]) {
if ([value[@"code"] isEqualToNumber:@0]) { if ([value[@"code"] isEqualToNumber:@0]) {
weakSelf.goodsNumbersLabe.text = [NSString stringWithFormat:@"%ld",goodsNumber]; weakSelf.goodsNumbersLabe.text = [NSString stringWithFormat:@"%ld",goodsNumber];
weakSelf.productPriceLabe.text = [NSString stringWithFormat:@"¥%.2f",[self.goodsNumbersLabe.text integerValue]*[self.clinchTextfield.text floatValue]];
} }
} }
}]; }];
...@@ -111,11 +109,7 @@ ...@@ -111,11 +109,7 @@
- (BOOL)textFieldShouldEndEditing:(UITextField *)textField - (BOOL)textFieldShouldEndEditing:(UITextField *)textField
{ {
Shoppersmanager *user = [Shoppersmanager manager]; Shoppersmanager *user = [Shoppersmanager manager];
if (![self isPureInt:textField.text]) { if ([textField.text floatValue] < [user.Shoppers.lowestDiscount floatValue]/100 * [self.model.goods.tagPrice floatValue])
if (self.promptStringBlock) {
self.promptStringBlock(@"输入格式错误");
}
} else if ([textField.text floatValue] < [user.Shoppers.lowestDiscount floatValue]/100 * [self.model.goods.tagPrice floatValue])
{ {
if (self.promptStringBlock) { if (self.promptStringBlock) {
self.promptStringBlock(@"当前价格低于你的权限范围!"); self.promptStringBlock(@"当前价格低于你的权限范围!");
...@@ -134,14 +128,51 @@ ...@@ -134,14 +128,51 @@
return YES; return YES;
} }
#pragma mark - <UITextFieldDelegate>
#pragma mark - 判断是否是浮点数 - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
- (BOOL)isPureInt:(NSString*)string{ {
NSScanner* scan = [NSScanner scannerWithString:string]; NSScanner *scanner = [NSScanner scannerWithString:string];
float val; NSCharacterSet *numbers;
return[scan scanFloat:&val] && [scan isAtEnd]; NSRange pointRange = [textField.text rangeOfString:@"."];
if ( (pointRange.length > 0) && (pointRange.location < range.location || pointRange.location > range.location + range.length) ){
numbers = [NSCharacterSet characterSetWithCharactersInString:@"0123456789"];
}else{
numbers = [NSCharacterSet characterSetWithCharactersInString:@"0123456789."];
}
if ( [textField.text isEqualToString:@""] && [string isEqualToString:@"."] ){
return NO;
}
short remain = 2; //保留 number位小数
NSString *tempStr = [textField.text stringByAppendingString:string];
NSUInteger strlen = [tempStr length];
if(pointRange.length > 0 && pointRange.location > 0){ //判断输入框内是否含有“.”。
if([string isEqualToString:@"."]){ //当输入框内已经含有“.”时,如果再输入“.”则被视为无效。
return NO;
}
if(strlen > 0 && (strlen - pointRange.location) > remain+1){ //当输入框内已经含有“.”,当字符串长度减去小数点前面的字符串长度大于需要要保留的小数点位数,则视当次输入无效。
return NO;
}
}
NSRange zeroRange = [textField.text rangeOfString:@"0"];
if(zeroRange.length == 1 && zeroRange.location == 0){ //判断输入框第一个字符是否为“0”
if(![string isEqualToString:@"0"] && ![string isEqualToString:@"."] && [textField.text length] == 1){ //当输入框只有一个字符并且字符为“0”时,再输入不为“0”或者“.”的字符时,则将此输入替换输入框的这唯一字符。
textField.text = string;
return NO;
}else{
if(pointRange.length == 0 && pointRange.location > 0){ //当输入框第一个字符为“0”时,并且没有“.”字符时,如果当此输入的字符为“0”,则视当此输入无效。
if([string isEqualToString:@"0"]){
return NO;
}
}
}
}
NSString *buffer;
if ( ![scanner scanCharactersFromSet:numbers intoString:&buffer] && ([string length] != 0) ){
return NO;
}else{
return YES;
}
} }
@end @end
...@@ -166,14 +166,16 @@ ...@@ -166,14 +166,16 @@
cell.delegate = self; cell.delegate = self;
cell.cellindex = indexPath.row; cell.cellindex = indexPath.row;
//cell选中回调 //cell选中回调
__weak typeof(self) weakSelf = self; __weak typeof(cell) weakCell = cell;
WS(weakSelf);
[cell setReturnCellblock:^(NSInteger index) { [cell setReturnCellblock:^(NSInteger index) {
[weakSelf setSelectedButton:index]; [weakSelf setSelectedButton:index];
}]; }];
//提示框回调 //提示框回调
[cell setPromptStringBlock:^(NSString *string) { [cell setPromptStringBlock:^(NSString *string) {
[weakSelf ErrorMBProgressView:string]; [weakSelf SHOWPrompttext:string ComcpleteBlock:^{
[weakCell.clinchTextfield becomeFirstResponder];
}];
}]; }];
return cell; return cell;
} }
...@@ -360,6 +362,7 @@ ...@@ -360,6 +362,7 @@
//没有选中任何商品 //没有选中任何商品
if (codeArr.count == 0) { if (codeArr.count == 0) {
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
[self SHOWPrompttext:@"未选中商品"];
return; return;
} }
delecteGoods.cartIds = codeArr; delecteGoods.cartIds = codeArr;
...@@ -406,11 +409,9 @@ ...@@ -406,11 +409,9 @@
//保存商品数量 //保存商品数量
ShopcarModel *model = [self.shopResponseArray objectAtIndex_opple:cellindex]; ShopcarModel *model = [self.shopResponseArray objectAtIndex_opple:cellindex];
model.goodsNum = goodsNumber; model.goodsNum = goodsNumber;
// [self.shopResponseArray replaceObjectAtIndex:cellindex withObject:model];
//保存成交价格 //保存成交价格
ShopcarModel *Newmodel = [self.shopResponseArray objectAtIndex_opple:cellindex]; ShopcarModel *Newmodel = [self.shopResponseArray objectAtIndex_opple:cellindex];
Newmodel.costPrice = [NSNumber numberWithFloat:costprice]; Newmodel.costPrice = [NSNumber numberWithFloat:costprice];
// [self.shopResponseArray replaceObjectAtIndex:cellindex withObject:Newmodel];
//在服务器保存数量、成交价 //在服务器保存数量、成交价
//购物车ID //购物车ID
NSString *carid = [[self.shopResponseArray objectAtIndex_opple:cellindex] fid]; NSString *carid = [[self.shopResponseArray objectAtIndex_opple:cellindex] fid];
......
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
[super viewDidLoad]; [super viewDidLoad];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
[self uiConfigAction]; [self uiConfigAction];
[self addViewcontroller]; [self addViewcontroller];
} }
...@@ -205,18 +205,18 @@ ...@@ -205,18 +205,18 @@
if (![Shoppersmanager manager].currentCustomer) { if (![Shoppersmanager manager].currentCustomer) {
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view.window animated:YES]; MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view.window animated:YES];
hud.label.text = @"必须设置当前客户才能访问购物车"; hud.labelText = @"必须设置当前客户才能访问购物车";
hud.margin = 10.f; hud.margin = 10.f;
hud.bezelView.color = [UIColor whiteColor]; hud.color = [[UIColor blackColor] colorWithAlphaComponent:0.5];
hud.minSize = CGSizeMake(200, 50); hud.minSize = CGSizeMake(200, 50);
hud.animationType = MBProgressHUDAnimationZoom; hud.animationType = MBProgressHUDAnimationZoom;
hud.mode = MBProgressHUDModeText; hud.mode = MBProgressHUDModeText;
hud.removeFromSuperViewOnHide = YES; hud.removeFromSuperViewOnHide = YES;
[hud hideAnimated:YES afterDelay:1.0f]; [hud hide:YES afterDelay:1.0f];
}else }else
{ {
self.selectedIndex = 8; self.selectedIndex = 8;
} }
break; break;
...@@ -300,10 +300,10 @@ ...@@ -300,10 +300,10 @@
#pragma mark -搜索框代理方法 #pragma mark -搜索框代理方法
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField - (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{ {
//返回根视图 //返回根视图
[[NSNotificationCenter defaultCenter] postNotificationName:POPROOTCONTROLLER object:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:POPROOTCONTROLLER object:nil];
self.selectedIndex = 9; self.selectedIndex = 9;
return YES; return YES;
} }
...@@ -346,14 +346,14 @@ ...@@ -346,14 +346,14 @@
if (![Shoppersmanager manager].currentCustomer) { if (![Shoppersmanager manager].currentCustomer) {
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view.window animated:YES]; MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view.window animated:YES];
hud.label.text = @"必须设置当前客户才能访问购物车"; hud.labelText = @"必须设置当前客户才能访问购物车";
hud.margin = 10.f; hud.margin = 10.f;
hud.bezelView.color = [UIColor whiteColor]; hud.color = [[UIColor blackColor] colorWithAlphaComponent:0.5];
hud.minSize = CGSizeMake(200, 50); hud.minSize = CGSizeMake(200, 50);
hud.animationType = MBProgressHUDAnimationZoom; hud.animationType = MBProgressHUDAnimationZoom;
hud.mode = MBProgressHUDModeText; hud.mode = MBProgressHUDModeText;
hud.removeFromSuperViewOnHide = YES; hud.removeFromSuperViewOnHide = YES;
[hud hideAnimated:YES afterDelay:1.0f]; [hud hide:YES afterDelay:1.0f];
}else }else
{ {
......
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
if (progress >= 1) { if (progress >= 1) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
self.TCHud.label.text = @"上传完成"; self.TCHud.labelText = @"上传完成";
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
}); });
}else }else
...@@ -157,12 +157,12 @@ ...@@ -157,12 +157,12 @@
} }
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
self.TCHud.label.text = @"上传失败"; self.TCHud.labelText = @"上传失败";
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
}); });
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
self.TCHud.label.text = @"上传失败"; self.TCHud.labelText = @"上传失败";
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
}); });
}]; }];
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<key>CFBundleName</key> <key>CFBundleName</key>
<string>欧立方</string> <string>欧立方</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.1.0</string> <string>1.1.1</string>
<key>CFBundleURLTypes</key> <key>CFBundleURLTypes</key>
<array> <array>
<dict> <dict>
......
...@@ -2056,21 +2056,21 @@ ...@@ -2056,21 +2056,21 @@
</imageView> </imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="名称" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="1Ax-ZU-BSA"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="名称" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="1Ax-ZU-BSA">
<rect key="frame" x="105" y="8" width="173" height="20"/> <rect key="frame" x="105" y="8" width="173" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/> <fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="规格" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="GuM-D9-qK2"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="规格" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="GuM-D9-qK2">
<rect key="frame" x="105" y="29" width="173" height="20"/> <rect key="frame" x="105" y="29" width="173" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/> <fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="代码" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="bLy-NR-CRc"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="代码" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="bLy-NR-CRc">
<rect key="frame" x="105" y="50" width="173" height="20"/> <rect key="frame" x="105" y="50" width="173" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/> <fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
......
...@@ -20,7 +20,7 @@ PODS: ...@@ -20,7 +20,7 @@ PODS:
- IQKeyboardManager (4.0.6) - IQKeyboardManager (4.0.6)
- JSONModel (1.2.0) - JSONModel (1.2.0)
- Masonry (1.0.2) - Masonry (1.0.2)
- MBProgressHUD (1.0.0) - MBProgressHUD (0.9.2)
- MJExtension (3.0.13) - MJExtension (3.0.13)
- MJRefresh (3.1.12) - MJRefresh (3.1.12)
- MMDrawerController (0.6.0): - MMDrawerController (0.6.0):
...@@ -48,7 +48,7 @@ DEPENDENCIES: ...@@ -48,7 +48,7 @@ DEPENDENCIES:
- IQKeyboardManager - IQKeyboardManager
- JSONModel (~> 1.2.0) - JSONModel (~> 1.2.0)
- Masonry - Masonry
- MBProgressHUD - MBProgressHUD (~> 0.9.1)
- MJExtension - MJExtension
- MJRefresh - MJRefresh
- MMDrawerController - MMDrawerController
...@@ -63,7 +63,7 @@ SPEC CHECKSUMS: ...@@ -63,7 +63,7 @@ SPEC CHECKSUMS:
IQKeyboardManager: c52debb1967799ae7addb98eab0cf328083a874f IQKeyboardManager: c52debb1967799ae7addb98eab0cf328083a874f
JSONModel: 12523685c4b623553ccf844bbbf7007624317b2c JSONModel: 12523685c4b623553ccf844bbbf7007624317b2c
Masonry: 7c429b56da9d4ee0bbb3ed77a5ea710d6a5df39e Masonry: 7c429b56da9d4ee0bbb3ed77a5ea710d6a5df39e
MBProgressHUD: 4890f671c94e8a0f3cf959aa731e9de2f036d71a MBProgressHUD: 1569cf7ace17a8bac47aabfbb8580a49690386d1
MJExtension: 5932755f451458eefa24239358817f8d291240c7 MJExtension: 5932755f451458eefa24239358817f8d291240c7
MJRefresh: b96cdb21c4aa75a7b07654311ab2f315c497e806 MJRefresh: b96cdb21c4aa75a7b07654311ab2f315c497e806
MMDrawerController: e3a54a5570388463ad3b36975251575b50c4e1a0 MMDrawerController: e3a54a5570388463ad3b36975251575b50c4e1a0
......
Copyright © 2009-2016 Matej Bukovinski Copyright (c) 2009-2015 Matej Bukovinski
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -20,7 +20,7 @@ PODS: ...@@ -20,7 +20,7 @@ PODS:
- IQKeyboardManager (4.0.6) - IQKeyboardManager (4.0.6)
- JSONModel (1.2.0) - JSONModel (1.2.0)
- Masonry (1.0.2) - Masonry (1.0.2)
- MBProgressHUD (1.0.0) - MBProgressHUD (0.9.2)
- MJExtension (3.0.13) - MJExtension (3.0.13)
- MJRefresh (3.1.12) - MJRefresh (3.1.12)
- MMDrawerController (0.6.0): - MMDrawerController (0.6.0):
...@@ -48,7 +48,7 @@ DEPENDENCIES: ...@@ -48,7 +48,7 @@ DEPENDENCIES:
- IQKeyboardManager - IQKeyboardManager
- JSONModel (~> 1.2.0) - JSONModel (~> 1.2.0)
- Masonry - Masonry
- MBProgressHUD - MBProgressHUD (~> 0.9.1)
- MJExtension - MJExtension
- MJRefresh - MJRefresh
- MMDrawerController - MMDrawerController
...@@ -63,7 +63,7 @@ SPEC CHECKSUMS: ...@@ -63,7 +63,7 @@ SPEC CHECKSUMS:
IQKeyboardManager: c52debb1967799ae7addb98eab0cf328083a874f IQKeyboardManager: c52debb1967799ae7addb98eab0cf328083a874f
JSONModel: 12523685c4b623553ccf844bbbf7007624317b2c JSONModel: 12523685c4b623553ccf844bbbf7007624317b2c
Masonry: 7c429b56da9d4ee0bbb3ed77a5ea710d6a5df39e Masonry: 7c429b56da9d4ee0bbb3ed77a5ea710d6a5df39e
MBProgressHUD: 4890f671c94e8a0f3cf959aa731e9de2f036d71a MBProgressHUD: 1569cf7ace17a8bac47aabfbb8580a49690386d1
MJExtension: 5932755f451458eefa24239358817f8d291240c7 MJExtension: 5932755f451458eefa24239358817f8d291240c7
MJRefresh: b96cdb21c4aa75a7b07654311ab2f315c497e806 MJRefresh: b96cdb21c4aa75a7b07654311ab2f315c497e806
MMDrawerController: e3a54a5570388463ad3b36975251575b50c4e1a0 MMDrawerController: e3a54a5570388463ad3b36975251575b50c4e1a0
......
This diff is collapsed.
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/MBProgressHUD" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Bugly" "${PODS_ROOT}/Headers/Public/DZNEmptyDataSet" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/JSONModel" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MMDrawerController" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/UMengSocial" HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/MBProgressHUD" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Bugly" "${PODS_ROOT}/Headers/Public/DZNEmptyDataSet" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/JSONModel" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MMDrawerController" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/UMengSocial"
OTHER_LDFLAGS = -framework "CoreGraphics" -framework "QuartzCore" OTHER_LDFLAGS = -framework "CoreGraphics"
PODS_ROOT = ${SRCROOT} PODS_ROOT = ${SRCROOT}
SKIP_INSTALL = YES SKIP_INSTALL = YES
\ No newline at end of file
...@@ -125,7 +125,7 @@ The MIT License in plain English: http://www.touch-code-magazine.com/JSONModel/M ...@@ -125,7 +125,7 @@ The MIT License in plain English: http://www.touch-code-magazine.com/JSONModel/M
## MBProgressHUD ## MBProgressHUD
Copyright © 2009-2016 Matej Bukovinski Copyright (c) 2009-2015 Matej Bukovinski
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
......
...@@ -160,7 +160,7 @@ The MIT License in plain English: http://www.touch-code-magazine.com/JSONModel/M ...@@ -160,7 +160,7 @@ The MIT License in plain English: http://www.touch-code-magazine.com/JSONModel/M
</dict> </dict>
<dict> <dict>
<key>FooterText</key> <key>FooterText</key>
<string>Copyright &#169; 2009-2016 Matej Bukovinski <string>Copyright (c) 2009-2015 Matej Bukovinski
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
{ {
if (_TCHud == nil) { if (_TCHud == nil) {
_TCHud = [MBProgressHUD showHUDAddedTo:SHARED_APPDELEGATE.window animated:YES]; _TCHud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
} }
return _TCHud; return _TCHud;
} }
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
[weakSelf restoreRootViewController:loginVC]; [weakSelf restoreRootViewController:loginVC];
}]]; }]];
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[self presentViewController:alert animated:YES completion:nil]; [self presentViewController:alert animated:YES completion:nil];
}); });
} }
...@@ -118,13 +118,13 @@ ...@@ -118,13 +118,13 @@
#pragma mark -渐隐提示框回调 #pragma mark -渐隐提示框回调
- (void)SHOWPrompttext:(NSString *)Text ComcpleteBlock:(void(^)())completed - (void)SHOWPrompttext:(NSString *)Text ComcpleteBlock:(void(^)())completed
{ {
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:SHARED_APPDELEGATE.window animated:YES]; MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view.window animated:YES];
hud.label.text = Text; hud.labelText = Text;
hud.animationType = MBProgressHUDAnimationZoom; hud.animationType = MBProgressHUDAnimationZoom;
hud.mode = MBProgressHUDModeText; hud.mode = MBProgressHUDModeText;
hud.removeFromSuperViewOnHide = YES; hud.removeFromSuperViewOnHide = YES;
[hud hideAnimated:YES afterDelay:2.0]; [hud hide:YES afterDelay:1.0f];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
if (completed) { if (completed) {
completed(); completed();
} }
...@@ -136,8 +136,8 @@ ...@@ -136,8 +136,8 @@
{ {
self.TCHud.animationType = MBProgressHUDAnimationZoom; self.TCHud.animationType = MBProgressHUDAnimationZoom;
self.TCHud.mode = MBProgressHUDModeIndeterminate; self.TCHud.mode = MBProgressHUDModeIndeterminate;
self.TCHud.bezelView.color = [UIColor whiteColor]; self.TCHud.color = [UIColor clearColor];
self.TCHud.contentColor = kMainBlueColor; self.TCHud.activityIndicatorColor = kMainBlueColor;
self.TCHud.removeFromSuperViewOnHide = YES; self.TCHud.removeFromSuperViewOnHide = YES;
} }
...@@ -148,8 +148,8 @@ ...@@ -148,8 +148,8 @@
{ {
self.TCHud.mode = MBProgressHUDModeDeterminateHorizontalBar; self.TCHud.mode = MBProgressHUDModeDeterminateHorizontalBar;
self.TCHud.label.text = @"上传中...."; self.TCHud.labelText = @"上传中....";
self.TCHud.label.font = [UIFont systemFontOfSize:12]; self.TCHud.labelFont = [UIFont systemFontOfSize:12];
self.TCHud.progress = progress; self.TCHud.progress = progress;
self.TCHud.removeFromSuperViewOnHide = YES; self.TCHud.removeFromSuperViewOnHide = YES;
} }
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
#pragma mark -移除MBProgressHUD等待视图 #pragma mark -移除MBProgressHUD等待视图
- (void)RemoveMBProgressHUDLoding; - (void)RemoveMBProgressHUDLoding;
{ {
[_TCHud hideAnimated:YES]; [_TCHud hide:YES];
_TCHud = nil; _TCHud = nil;
} }
...@@ -165,28 +165,28 @@ ...@@ -165,28 +165,28 @@
#pragma mark -显示成功的提示框 #pragma mark -显示成功的提示框
- (void)SuccessMBProgressView:(NSString *)successString - (void)SuccessMBProgressView:(NSString *)successString
{ {
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:SHARED_APPDELEGATE.window animated:YES]; MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view.window animated:YES];
hud.mode = MBProgressHUDModeCustomView; hud.mode = MBProgressHUDModeCustomView;
UIImage *image = [[UIImage imageNamed:@"Checkmark"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; UIImage *image = [[UIImage imageNamed:@"Checkmark"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
hud.customView = [[UIImageView alloc] initWithImage:image]; hud.customView = [[UIImageView alloc] initWithImage:image];
hud.bezelView.color = [UIColor whiteColor]; hud.color = [[UIColor blackColor] colorWithAlphaComponent:0.6];
hud.label.font = [UIFont systemFontOfSize:12]; hud.labelFont = [UIFont systemFontOfSize:12];
hud.label.text = successString; hud.labelText = successString;
[hud hideAnimated:YES afterDelay:1.0]; [hud hide:YES afterDelay:1];
} }
#pragma mark -显示信息的提示框 #pragma mark -显示信息的提示框
- (void)ErrorMBProgressView:(NSString *)errorString - (void)ErrorMBProgressView:(NSString *)errorString
{ {
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:SHARED_APPDELEGATE.window animated:YES]; MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
hud.label.text = errorString; hud.labelText = errorString;
hud.margin = 10.f; hud.margin = 10.f;
hud.bezelView.color = [UIColor whiteColor]; hud.color = [[UIColor blackColor] colorWithAlphaComponent:0.5];
hud.minSize = CGSizeMake(250, 70); hud.minSize = CGSizeMake(250, 70);
hud.animationType = MBProgressHUDAnimationZoom; hud.animationType = MBProgressHUDAnimationZoom;
hud.mode = MBProgressHUDModeText; hud.mode = MBProgressHUDModeText;
hud.removeFromSuperViewOnHide = YES; hud.removeFromSuperViewOnHide = YES;
[hud hideAnimated:YES afterDelay:1.0f]; [hud hide:YES afterDelay:1.0f];
} }
...@@ -194,15 +194,15 @@ ...@@ -194,15 +194,15 @@
#pragma mark -渐隐提示框 #pragma mark -渐隐提示框
- (void)SHOWPrompttext:(NSString *)Text - (void)SHOWPrompttext:(NSString *)Text
{ {
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:SHARED_APPDELEGATE.window animated:YES]; MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
hud.label.text = Text; hud.labelText = Text;
hud.margin = 10.f; hud.margin = 10.f;
hud.bezelView.color = [UIColor whiteColor]; hud.color = [[UIColor blackColor] colorWithAlphaComponent:0.5];
hud.minSize = CGSizeMake(200, 50); hud.minSize = CGSizeMake(200, 50);
hud.animationType = MBProgressHUDAnimationZoom; hud.animationType = MBProgressHUDAnimationZoom;
hud.mode = MBProgressHUDModeText; hud.mode = MBProgressHUDModeText;
hud.removeFromSuperViewOnHide = YES; hud.removeFromSuperViewOnHide = YES;
[hud hideAnimated:YES afterDelay:1.0f]; [hud hide:YES afterDelay:1.0f];
} }
...@@ -272,20 +272,20 @@ ...@@ -272,20 +272,20 @@
#pragma mark 调用airPrint无线打印机 #pragma mark 调用airPrint无线打印机
- (void)callAirprintWithURL:(NSURL *)datasurl SuccessBlock:(void (^)())success ErrorBlock:(void (^)())failed - (void)callAirprintWithURL:(NSURL *)datasurl SuccessBlock:(void (^)())success ErrorBlock:(void (^)())failed
{ {
// NSData *mypdfdata = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"The Swift Programming Language 中文版 - v1.2" ofType:@"pdf"]]; // NSData *mypdfdata = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"The Swift Programming Language 中文版 - v1.2" ofType:@"pdf"]];
UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController]; UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController];
pic.delegate = self; pic.delegate = self;
[self.webView loadRequest:[NSURLRequest requestWithURL:datasurl]];//网页 [self.webView loadRequest:[NSURLRequest requestWithURL:datasurl]];//网页
self.webView.delegate = self; self.webView.delegate = self;
pic.printFormatter = [self.webView viewPrintFormatter];//布局打印视图绘制的内容。 pic.printFormatter = [self.webView viewPrintFormatter];//布局打印视图绘制的内容。
UIPrintInfo *printInfo = [UIPrintInfo printInfo]; UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputGeneral; printInfo.outputType = UIPrintInfoOutputGeneral;
printInfo.jobName = @"订单明细"; printInfo.jobName = @"订单明细";
printInfo.duplex = UIPrintInfoDuplexShortEdge; printInfo.duplex = UIPrintInfoDuplexShortEdge;
pic.printInfo = printInfo; pic.printInfo = printInfo;
pic.showsPageRange = YES; pic.showsPageRange = YES;
void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) = ^(UIPrintInteractionController *pic, BOOL completed, NSError *error) { void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) = ^(UIPrintInteractionController *pic, BOOL completed, NSError *error) {
if (completed) if (completed)
...@@ -299,7 +299,7 @@ ...@@ -299,7 +299,7 @@
failed(); failed();
} }
}; };
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
[pic presentAnimated:YES completionHandler:completionHandler]; [pic presentAnimated:YES completionHandler:completionHandler];
...@@ -346,7 +346,7 @@ ...@@ -346,7 +346,7 @@
#pragma mark -传入订单状态,返回当前状态图片 #pragma mark -传入订单状态,返回当前状态图片
+ (UIImage *)ReturnOrderStateImageWithStateCode:(NSInteger)ordercode + (UIImage *)ReturnOrderStateImageWithStateCode:(NSInteger)ordercode
{ {
const NSArray *imageArray = [NSArray arrayWithObjects:@"已撤销",@"已完成",@"已退货", nil]; const NSArray *imageArray = [NSArray arrayWithObjects:@"已撤销",@"已完成",@"已退货", nil];
switch (ordercode) { switch (ordercode) {
case 4://退货 case 4://退货
{ {
...@@ -374,7 +374,7 @@ ...@@ -374,7 +374,7 @@
#pragma mark -传入订单状态,返回订单文本信息,字体颜色 #pragma mark -传入订单状态,返回订单文本信息,字体颜色
+ (id)ReturnOrderStateTitleWithStateCode:(NSInteger)ordercode withPoint:(CGPoint)point WithCode:(NSInteger)code + (id)ReturnOrderStateTitleWithStateCode:(NSInteger)ordercode withPoint:(CGPoint)point WithCode:(NSInteger)code
{ {
switch (ordercode) { switch (ordercode) {
case 001://未付款 case 001://未付款
{ {
...@@ -386,7 +386,7 @@ ...@@ -386,7 +386,7 @@
break; break;
case 002://已付款 case 002://已付款
{ {
if (code) { if (code) {
return kTCColor(126, 191, 53); return kTCColor(126, 191, 53);
} }
...@@ -395,7 +395,7 @@ ...@@ -395,7 +395,7 @@
break; break;
case 003://已发货 case 003://已发货
{ {
if (code) { if (code) {
return kTCColor(240, 180, 51); return kTCColor(240, 180, 51);
} }
...@@ -404,7 +404,7 @@ ...@@ -404,7 +404,7 @@
break; break;
case 004://已退货 case 004://已退货
{ {
if (code) { if (code) {
return kTCColor(153, 153, 153); return kTCColor(153, 153, 153);
} }
...@@ -413,7 +413,7 @@ ...@@ -413,7 +413,7 @@
break; break;
case 005://已作废 case 005://已作废
{ {
if (code) { if (code) {
return kTCColor(153, 153, 153); return kTCColor(153, 153, 153);
} }
...@@ -422,7 +422,7 @@ ...@@ -422,7 +422,7 @@
break; break;
case 006://已完成 case 006://已完成
{ {
if (code) { if (code) {
return kTCColor(89, 172, 220); return kTCColor(89, 172, 220);
} }
......
...@@ -578,7 +578,7 @@ ...@@ -578,7 +578,7 @@
{ {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
self.TCHud.label.text = @"上传完成"; self.TCHud.labelText = @"上传完成";
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
}); });
} }
...@@ -588,7 +588,7 @@ ...@@ -588,7 +588,7 @@
{ {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
self.TCHud.label.text = @"上传失败"; self.TCHud.labelText = @"上传失败";
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
}); });
} }
......
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