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

完成客户、导购头像上传修改,筛选优化。。。。debug

parent 313eef06
......@@ -397,6 +397,15 @@
[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];
if ([customerModel.fid isEqualToString:[Customermanager manager].model.fid]) {
customerModel.picture = string;
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:i inSection:0];
[self.informationTableview reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationBottom];
break;
}
}
}];
}
......@@ -417,10 +426,9 @@
}
} WithprogressBlock:^(double progress) {
if (progress >= 1) {
weskSelf.TCHud.labelText = @"上传完成";
dispatch_async(dispatch_get_main_queue(), ^{
weskSelf.TCHud.labelText = @"上传完成";
[weskSelf RemoveMBProgressHUDLoding];
});
}else
......@@ -430,13 +438,13 @@
});
}
} WithErrorCodeBlock:^(id errorCodeValue) {
weskSelf.TCHud.labelText = @"上传失败";
dispatch_async(dispatch_get_main_queue(), ^{
weskSelf.TCHud.labelText = @"上传失败";
[weskSelf RemoveMBProgressHUDLoding];
});
} WithFailureBlock:^(NSError *error) {
weskSelf.TCHud.labelText = @"上传失败";
dispatch_async(dispatch_get_main_queue(), ^{
weskSelf.TCHud.labelText = @"上传失败";
[weskSelf RemoveMBProgressHUDLoding];
});
}];
......
......@@ -184,7 +184,6 @@
}
else if (self.orderRecordButton.selected)//订单记录
{
self.orderRecordPage = 1;
if (self.orderRecordPage ++ > self.orderRecordTotalPage) {
[self.ClientdetailsTableview.mj_footer endRefreshingWithNoMoreData];
}else
......
......@@ -317,7 +317,7 @@
}
[self CreateMBProgressHUDLoding];
//发送验证码
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@%@",ServerAddress,@"/system/sendSms?mobilephone=",inputPhoneNumber] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@/system/sendSms?mobilephone=%@&username=%@",ServerAddress,inputPhoneNumber,self.identityView.userName.text] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
......@@ -383,15 +383,11 @@
{
// 验证码必须填写
if (self.identityView.verificationCode.text.length == 0) {
[self ErrorMBProgressView:@"验证码不能为空"];
return;
} else {
//验证验证码
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@%@",ServerAddress,@"/employee/validateSmsCode?code=",self.identityView.verificationCode.text] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
} else {
[self.sendTimer invalidate];
self.resetPasswordView = [[[NSBundle mainBundle] loadNibNamed:@"authenticateView" owner:self options:nil]lastObject];
......@@ -405,17 +401,6 @@
[UIView animateWithDuration:0.2 animations:^{
self.resetPasswordView.alpha = 1;
}];
}else
{
[self ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(NSError *error) {
[self ErrorMBProgressView:error.localizedDescription];
[self RemoveMBProgressHUDLoding];
}];
}
}
......@@ -444,6 +429,7 @@
ResetPasswordRequest *passwrod = [[ResetPasswordRequest alloc]init];
passwrod.fnewPassword = self.resetPasswordView.newpass.text;
passwrod.username = self.userName.text;
passwrod.smsCode = self.identityView.verificationCode.text;
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/employee/resetPassword"] WithRequestType:0 WithParameter:passwrod WithReturnValueBlock:^(id returnValue) {
......@@ -464,9 +450,7 @@
[self ErrorMBProgressView:error.localizedDescription];
[self RemoveMBProgressHUDLoding];
}];
}
......@@ -495,9 +479,6 @@
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
......
......@@ -49,6 +49,11 @@
*/
@property (weak, nonatomic) IBOutlet UILabel *specifications;
/**
* 数据源
*/
@property (nonatomic,strong) TOGoodsEntity *model;
......
......@@ -32,4 +32,14 @@
}
- (void)setModel:(TOGoodsEntity *)model
{
NSArray *imageArray = [model.pictures componentsSeparatedByString:@","];
[self.productImageView sd_setImageWithURL:[NSURL URLWithString:[imageArray firstObject]] placeholderImage:REPLACEIMAGE];
self.productPrice.text = [NSString stringWithFormat:@"¥%.2f",[model.tagPrice floatValue]];
self.productParameter.text = model.name;
self.specifications.text = [NSString stringWithFormat:@"%@(%@)",model.code,model.size];
}
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
......@@ -14,7 +14,7 @@
<rect key="frame" x="20" y="21" width="385" height="358"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="140046029-MX260-D112-03-星冠-5700K(4)" id="tLl-kB-n3W">
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" id="tLl-kB-n3W">
<rect key="frame" x="0.0" y="0.0" width="385" height="358"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</imageView>
......@@ -42,7 +42,7 @@
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="LAD-89757" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="b7B-yI-JEC">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="b7B-yI-JEC">
<rect key="frame" x="588" y="42" width="163" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="20"/>
......@@ -56,8 +56,8 @@
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="名称字段" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="NlJ-8b-gcl">
<rect key="frame" x="588" y="76" width="130" height="17"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="NlJ-8b-gcl">
<rect key="frame" x="588" y="76" width="163" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
......@@ -70,7 +70,7 @@
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="欧普" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Hf9-WK-7u5">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Hf9-WK-7u5">
<rect key="frame" x="588" y="106" width="130" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
......@@ -84,7 +84,7 @@
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="¥12800" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Rka-oV-nyM">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Rka-oV-nyM">
<rect key="frame" x="588" y="148" width="163" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="20"/>
......@@ -105,7 +105,7 @@
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="34" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="zXN-Uh-XtZ">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="zXN-Uh-XtZ">
<rect key="frame" x="588" y="272" width="70" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
......@@ -170,7 +170,6 @@
</view>
</objects>
<resources>
<image name="140046029-MX260-D112-03-星冠-5700K(4)" width="600" height="450"/>
<image name="2" width="45" height="45"/>
<image name="add" width="49" height="45"/>
<image name="icon-2" width="25" height="15"/>
......
......@@ -13,6 +13,8 @@
#import "goodsDetailsTableViewCell.h"
#import "FullScreenViewController.h"
@interface ProductDetailsViewController ()<UITableViewDelegate,UITableViewDataSource,UITextFieldDelegate>
@property (nonatomic,strong) ProductDetailsHeaderView *headerView;
......@@ -70,7 +72,6 @@
[self uiConfigAction];
[self getGoodsListDetails];
}
#pragma mark -UI
......@@ -81,7 +82,6 @@
self.productDetilsTableview.delegate = self;
[self.productDetilsTableview registerNib:[UINib nibWithNibName:@"goodsDetailsTableViewCell" bundle:nil] forCellReuseIdentifier:@"goodsdetailscell"];
[self CreateHeaderView];
}
......@@ -216,10 +216,96 @@
return 170;
}
return ScreenWidth*3/4;
NSURL *url = [NSURL URLWithString:[self.goodsDetailsArray objectAtIndex_opple:indexPath.row]];
return [ProductDetailsViewController getImageSizeWithURL:url].height;
}
#pragma mark -计算图片高度
+(CGSize)getImageSizeWithURL:(id)imageURL
{
NSURL* URL = nil;
if([imageURL isKindOfClass:[NSURL class]]){
URL = imageURL;
}
if([imageURL isKindOfClass:[NSString class]]){
URL = [NSURL URLWithString:imageURL];
}
if(URL == nil)
return CGSizeZero; // url不正确返回CGSizeZero
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:URL];
NSString* pathExtendsion = [URL.pathExtension lowercaseString];
CGSize size = CGSizeZero;
if([pathExtendsion isEqualToString:@"jpg"]){
size = [self getJPGImageSizeWithRequest:request];
}
if(CGSizeEqualToSize(CGSizeZero, size)) // 如果获取文件头信息失败,发送异步请求请求原图
{
NSData* data = [NSURLConnection sendSynchronousRequest:[NSURLRequest requestWithURL:URL] returningResponse:nil error:nil];
UIImage* image = [UIImage imageWithData:data];
if(image)
{
size = image.size;
}
}
return size;
}
+(CGSize)getJPGImageSizeWithRequest:(NSMutableURLRequest*)request
{
[request setValue:@"bytes=0-209" forHTTPHeaderField:@"Range"];
NSData* data = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
if ([data length] <= 0x58) {
return CGSizeZero;
}
if ([data length] < 210) {// 肯定只有一个DQT字段
short w1 = 0, w2 = 0;
[data getBytes:&w1 range:NSMakeRange(0x60, 0x1)];
[data getBytes:&w2 range:NSMakeRange(0x61, 0x1)];
short w = (w1 << 8) + w2;
short h1 = 0, h2 = 0;
[data getBytes:&h1 range:NSMakeRange(0x5e, 0x1)];
[data getBytes:&h2 range:NSMakeRange(0x5f, 0x1)];
short h = (h1 << 8) + h2;
return CGSizeMake(w, h);
} else {
short word = 0x0;
[data getBytes:&word range:NSMakeRange(0x15, 0x1)];
if (word == 0xdb) {
[data getBytes:&word range:NSMakeRange(0x5a, 0x1)];
if (word == 0xdb) {// 两个DQT字段
short w1 = 0, w2 = 0;
[data getBytes:&w1 range:NSMakeRange(0xa5, 0x1)];
[data getBytes:&w2 range:NSMakeRange(0xa6, 0x1)];
short w = (w1 << 8) + w2;
short h1 = 0, h2 = 0;
[data getBytes:&h1 range:NSMakeRange(0xa3, 0x1)];
[data getBytes:&h2 range:NSMakeRange(0xa4, 0x1)];
short h = (h1 << 8) + h2;
return CGSizeMake(w, h);
} else {// 一个DQT字段
short w1 = 0, w2 = 0;
[data getBytes:&w1 range:NSMakeRange(0x60, 0x1)];
[data getBytes:&w2 range:NSMakeRange(0x61, 0x1)];
short w = (w1 << 8) + w2;
short h1 = 0, h2 = 0;
[data getBytes:&h1 range:NSMakeRange(0x5e, 0x1)];
[data getBytes:&h2 range:NSMakeRange(0x5f, 0x1)];
short h = (h1 << 8) + h2;
return CGSizeMake(w, h);
}
} else {
return CGSizeZero;
}
}
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 2;
......@@ -281,7 +367,6 @@
#pragma mark -UITextFieldDelegate
- (void)textFieldDidEndEditing:(UITextField *)textField
{
NSLog(@"%@",textField.text);
NSString *inputString = textField.text;
if (![self isPureInt:inputString]) {
......@@ -289,7 +374,6 @@
textField.text = @"1";
return;
}
if ([inputString integerValue] > [self.entity.number integerValue]) {
[self ErrorMBProgressView:@"超过库存数量"];
......@@ -298,26 +382,6 @@
}
}
//
//@synthesize fid;
//@synthesize createName;
//@synthesize createBy;
//@synthesize createDate;
//@synthesize updateName;
//@synthesize updateBy;
//@synthesize updateDate;
//@synthesize sysOrgCode;
////@synthesize goodsId;
//@synthesize goodsCode;
//@synthesize goodsName;
//@synthesize goodsCover;
//@synthesize goodsSpec;
//@synthesize goodsBrand;
//@synthesize goodsSellerPrice;
//@synthesize goodsNum;
//@synthesize goodsPrice;
//@synthesize goodsTotalPrice;
//@synthesize consumerId;
#pragma mark -开发加入购物车动画
- (void)StartAddShoppingCarAnimationWithimage:(UIImage *)image withStartpoint:(CGPoint)point withSize:(CGSize)size
......@@ -419,7 +483,6 @@
} WithFailureBlock:^(id error) {
[self ErrorMBProgressView:@"添加购物车失败"];
}];
}
......
......@@ -69,11 +69,6 @@
@property (nonatomic,assign) int totalPages;
@end
@implementation ProductLibraryViewController
......@@ -121,15 +116,11 @@
[self uiConfigAction];
[self GetdatasAction];
}
#pragma mark -获取商品列表数据
- (void)getGoodsListDatasisRemove:(BOOL)remove Withobject:(GoodsCondition *)conditon
{
__weak typeof(self)weakSelf = self;
[self getGoodsListdatas:conditon returnResponse:^(GoodsResponse *response) {
......@@ -155,8 +146,6 @@
[self.screeningDatas removeAllObjects];
}
GoodsFilter *goodsStyle = [[GoodsFilter alloc]initWithDictionary:returnValue[@"data"] error:nil];
[self.screeningDatas addObject:goodsStyle.styles];
[self.screeningDatas addObject:goodsStyle.categories];
[self.screeningDatas addObject:goodsStyle.space];
......@@ -181,7 +170,6 @@
#pragma mark -获取商品列表数据
- (void)getGoodsListdatas:(GoodsCondition *)conditon returnResponse:(void(^)(GoodsResponse *))finish
{
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/goods/query"] WithRequestType:0 WithParameter:conditon WithReturnValueBlock:^(id returnValue) {
......@@ -281,12 +269,10 @@
weakSelf.condtionModel.endprice = [NSNumber numberWithInteger:[[spacrArray objectAtIndex_opple:1] integerValue]];
}
break;
default:
weakSelf.condtionModel.nameLike = weakSelf.selectedCode;
break;
}
}
[weakSelf.productCollectionView.mj_footer resetNoMoreData];
[weakSelf getScreeningdatasisRemoveArray:YES];
......@@ -319,7 +305,39 @@
weakSelf.condtionModel.page = Newpage;
//搜索
if (_selectedCode) {
weakSelf.condtionModel.categoryEquals = _selectedCode;
switch (weakSelf.selectedIndex) {
case 0://风格
{
weakSelf.condtionModel.styleEquals = weakSelf.selectedCode;
}
break;
case 1://类型
{
weakSelf.condtionModel.categoryEquals = weakSelf.selectedCode;
}
break;
case 2://空间
{
weakSelf.condtionModel.spaceEquals = weakSelf.selectedCode;
}
break;
case 3://材质
{
weakSelf.condtionModel.materialEqueals = weakSelf.selectedCode;
}
break;
case 4://价格
{
//价格字符串切割
NSArray *spacrArray = [weakSelf.selectedCode componentsSeparatedByString:@"到"];
weakSelf.condtionModel.startprice = [NSNumber numberWithInteger:[[spacrArray objectAtIndex_opple:0] integerValue]];
weakSelf.condtionModel.endprice = [NSNumber numberWithInteger:[[spacrArray objectAtIndex_opple:1] integerValue]];
}
break;
default:
weakSelf.condtionModel.nameLike = weakSelf.selectedCode;
break;
}
}
[weakSelf getGoodsListDatasisRemove:NO Withobject:self.condtionModel];
}
......@@ -367,7 +385,6 @@
}
#pragma mark -筛选按钮
- (void)CreatescreeningButton
{
......@@ -401,13 +418,8 @@
{
ProductCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"productcell" forIndexPath:indexPath];
TOGoodsEntity *model = [self.datasArray objectAtIndex_opple:indexPath.item];
NSArray *imageArray = [model.pictures componentsSeparatedByString:@","];
[cell.productImageView sd_setImageWithURL:[NSURL URLWithString:[imageArray firstObject]] placeholderImage:REPLACEIMAGE];
cell.productPrice.text = [NSString stringWithFormat:@"¥%@",model.tagPrice];
cell.cellindex = indexPath.item;
cell.productParameter.text = model.name;
cell.specifications.text = [NSString stringWithFormat:@"%@(%@)",model.code,model.size];
cell.model = model;
cell.cellindex = indexPath.row;
//加入购物车
__weak typeof(self) weakSelf = self;
......@@ -416,7 +428,6 @@
//判断是否有当前客户
if (![Shoppersmanager manager].currentCustomer) {
[self ErrorMBProgressView:@"必须设置当前客户"];
return;
}
......@@ -433,11 +444,11 @@
#pragma mark -开发加入购物车动画
- (void)StartAddShoppingCarAnimationWithimage:(UIImage *)image withStartpoint:(CGPoint)point withSize:(CGSize)size
{
// //起点
//起点
CGPoint startPoint = point;
// //终点
//终点
CGPoint endPoint = SHARED_APPDELEGATE.shoppingCarPoint;
// //控点
//控点
CGPoint controlPoint = CGPointMake(endPoint.x, startPoint.x);
......@@ -456,7 +467,6 @@
//关键帧
CAKeyframeAnimation *moveAnim = [CAKeyframeAnimation animationWithKeyPath:@"position"];
moveAnim.path = movePath.CGPath;
moveAnim.removedOnCompletion = YES;
......@@ -521,11 +531,6 @@
#pragma mark -筛选
- (void)ScreeningButtonClick
{
// ExperienceCentreViewController *ExperienceCenter = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"ExperienceCentre"];
// ExperienceCenter.modalPresentationStyle = UIModalPresentationOverFullScreen;
// UIPopoverPresentationController *popover = ExperienceCenter.popoverPresentationController;
// popover.sourceView = ExperienceCenter.view;
// [self presentViewController:ExperienceCenter animated:YES completion:nil];
self.screenView = [[[NSBundle mainBundle] loadNibNamed:@"ScreeningView" owner:self options:nil]firstObject];
self.screenView.frame = CGRectMake(0, 0, ScreenWidth, ScreenHeight);
......@@ -559,14 +564,12 @@
switch (sender.selectedSegmentIndex) {
case 0://分类
{
// self.selectedIndex = 0;
[self.screenSecondView removeFromSuperview];
[self CreateClassificationView];
}
break;
case 1://筛选
{
// self.selectedIndex = 0;
[self.screenFirstView removeFromSuperview];
[self CreateScreenSubView];
}
......@@ -601,7 +604,6 @@
}
#pragma mark -ScreeningButtonClickdelegate代理
- (void)screeningButtonClick:(NSInteger)buttontag
{
......@@ -624,6 +626,7 @@
- (void)selectedItem:(NSString *)typecode withTitle:(NSString *)title
{
[self emptyModel];
[self DismissScreenView];
if (self.selectedIndex == 4) {
self.selectedCode = title;
......@@ -635,8 +638,6 @@
}
#pragma mark -筛选子模块的
- (void)tableSelectedindex:(NSInteger)index
{
......@@ -687,8 +688,6 @@
self.condtionModel.startprice = condition.startprice;
self.condtionModel.endprice = condition.endprice;
self.selectedCode = nil;//清空单选
// [self.productCollectionView.mj_header beginRefreshing];
__weak typeof (self) Weakself = self;
[self getGoodsListdatas:condition returnResponse:^(GoodsResponse *response) {
......@@ -733,24 +732,15 @@
{
//取消子视图的的时间穿透,否则子视图的点击无效,会被传递到父视图响应
if (CGRectContainsPoint(self.screenView.backgroundView.frame, [touch locationInView:self.screenView])) {
return NO;
}
return YES;
}
//#pragma mark -释放
//- (void)dealloc
//{
// [[NSNotificationCenter defaultCenter]removeObserver:self];
//}
#pragma mark -添加至购物车
- (void)addGoodsShoppingbags:(TOGoodsEntity *)model complate:(void(^)())response
{
SaveShoppingCartRequest *shopCar = [[SaveShoppingCartRequest alloc]init];
shopCar.consumerId = [Customermanager manager].model.fid;
shopCar.goodsId = model.fid;
......@@ -807,6 +797,8 @@
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
[[SDImageCache sharedImageCache] clearDisk];
NSLog(@"结算到内存警告");
// Dispose of any resources that can be recreated.
}
......
......@@ -146,6 +146,10 @@
- (IBAction)addAddressButtonClick:(UIButton *)sender {
NSString *phoneNumber = self.PhoneNumber.text;
if (phoneNumber.length <= 0) {
[self ErrorMBProgressView:@"手机号码不能为空"];
return;
}
if (![HENLENSONG isValidateMobile:phoneNumber]) {
[self ErrorMBProgressView:@"手机号码格式不正确"];
......@@ -193,7 +197,13 @@
model.name = self.recipientPerson.text;
model.miblephone = self.PhoneNumber.text;
model.city = self.citySelected.currentTitle;
model.address = self.detailsAddress.text;
//地址拼接
if (![self.provincesString isEqualToString:[self.citySelected currentTitle]]) {
model.address = [NSString stringWithFormat:@"%@%@%@",self.provincesString,self.citySelected.currentTitle,self.detailsAddress.text];
}else
{
model.address = [NSString stringWithFormat:@"%@%@",self.citySelected.currentTitle,self.detailsAddress.text];
}
model.consumerId = [Customermanager manager].model.fid;
model.fid = returnValue[@"data"];
model.isSelected = NO;
......@@ -213,35 +223,9 @@
} WithFailureBlock:^(id error) {
NSLog(@"%@",error);
[self RemoveMBProgressHUDLoding];
}];
}
//@synthesize fid;
//@synthesize createDate;
//@synthesize sysOrgCode;
//@synthesize name;
//@synthesize miblephone;
//@synthesize province;
//@synthesize city;
//@synthesize country;
//@synthesize address;
//@synthesize state;
//@synthesize consumerId;
//#pragma mark -修改地址数据源
//- (void)setModel:(AddressModel *)model
//{
// _model = model;
// self.recipientPerson.text = model.name;
// self.PhoneNumber.text = model.miblephone;
// [self.citySelected setTitle:model.city forState:UIControlStateNormal];
// self.detailsAddress.text = model.address;
//
//}
#pragma mark -更改地址
......
......@@ -337,14 +337,13 @@
}else
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"StoryboardwithCYX" bundle:nil];
// ExperienceCentreViewController *ExperienceCenter = [storyboard instantiateViewControllerWithIdentifier:@"ExperienceCentre"];
// ExperienceCenter.modalPresentationStyle = UIModalPresentationOverFullScreen;
// 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];
ExperienceCentreViewController *ExperienceCenter = [storyboard instantiateViewControllerWithIdentifier:@"ExperienceCentre"];
ExperienceCenter.modalPresentationStyle = UIModalPresentationOverFullScreen;
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];
}
}
......
......@@ -92,7 +92,7 @@
#pragma -mark -UIImagePickerControllerDelegate
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info
{
// [DeviceDirectionManager instance].isHorizontal=NO;
[DeviceDirectionManager instance].isHorizontal=NO;
[self dismissViewControllerAnimated:YES completion:nil];
UIImage *Headimage = [info objectForKey:UIImagePickerControllerOriginalImage];
__weak typeof(self) weskSelf = self;
......@@ -117,12 +117,11 @@
{
[self ErrorMBProgressView:returnValue[@"message"]];
}
} WithprogressBlock:^(double progress) {
if (progress >= 1) {
self.TCHud.labelText = @"上传完成";
dispatch_async(dispatch_get_main_queue(), ^{
self.TCHud.labelText = @"上传完成";
[self RemoveMBProgressHUDLoding];
});
}else
......@@ -132,13 +131,13 @@
});
}
} WithErrorCodeBlock:^(id errorCodeValue) {
self.TCHud.labelText = @"上传失败";
dispatch_async(dispatch_get_main_queue(), ^{
self.TCHud.labelText = @"上传失败";
[self RemoveMBProgressHUDLoding];
});
} WithFailureBlock:^(NSError *error) {
self.TCHud.labelText = @"上传失败";
dispatch_async(dispatch_get_main_queue(), ^{
self.TCHud.labelText = @"上传失败";
[self RemoveMBProgressHUDLoding];
});
}];
......
<?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>
......
......@@ -9,6 +9,8 @@
#import "AppDelegate.h"
#import "LoginViewController.h"
#import "DeviceDirectionManager.h"
#import <Bugly/Bugly.h>
@interface AppDelegate ()
@end
......@@ -18,7 +20,9 @@
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
//bug检测
[Bugly startWithAppId:@"900033734"];
// [self performSelector:@selector(KclickAction) withObject:self afterDelay:3];
[self SetIQKeyboardManager];
[self RootViewcontroller];
[self detectionNetwork];
......@@ -59,6 +63,7 @@
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application
{
[[SDImageCache sharedImageCache] clearDisk];
[[SDImageCache sharedImageCache] setValue:nil forKey:@"memCache"];
}
......
......@@ -14,6 +14,7 @@ PODS:
- AFNetworking/Serialization (3.1.0)
- AFNetworking/UIKit (3.1.0):
- AFNetworking/NSURLSession
- Bugly (2.2.3)
- DZNEmptyDataSet (1.8.1)
- IQKeyboardManager (4.0.3)
- JSONModel (1.2.0)
......@@ -41,6 +42,7 @@ PODS:
DEPENDENCIES:
- AFNetworking (~> 3.1.0)
- Bugly (~> 2.2.3)
- DZNEmptyDataSet (~> 1.8.1)
- IQKeyboardManager (~> 4.0.0)
- JSONModel (~> 1.2.0)
......@@ -55,6 +57,7 @@ DEPENDENCIES:
SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
Bugly: db578ea92b2a6b132cc19f79adf3bcd3b0fe6769
DZNEmptyDataSet: 9525833b9e68ac21c30253e1d3d7076cc828eaa7
IQKeyboardManager: be9695ffc5a52077deb4847608f338771022d6d1
JSONModel: 12523685c4b623553ccf844bbbf7007624317b2c
......
......@@ -142,7 +142,7 @@
cell.selectedGoodsImageView.layer.borderWidth = 0;
}
NSArray *imags = [model.pictures componentsSeparatedByString:@","];
[cell.selectedGoodsImageView sd_setImageWithURL:[NSURL URLWithString:[imags firstObject]] placeholderImage:REPLACEIMAGE];
[cell.selectedGoodsImageView sd_setImageWithURL:[NSURL URLWithString:[imags firstObject]]];
return cell;
}
......
......@@ -36,42 +36,33 @@
/**
* AppDelegate代理
* 禁止所有的打印,提交AppStore时使用
*/
#define SHARED_APPDELEGATE ((AppDelegate *)([UIApplication sharedApplication].delegate))
//#ifdef DEBUG
//#define NSLog(...) NSLog(__VA_ARGS__)
//#define debugMethod() NSLog(@"%s", __func__)
//#else
//#define NSLog(...)
//#define debugMethod()
//#endif
/**
* 屏幕的物理高度
* AppDelegate代理
*/
#define ScreenHeight [UIScreen mainScreen].bounds.size.height
#define SHARED_APPDELEGATE ((AppDelegate *)([UIApplication sharedApplication].delegate))
/**
* 导航栏高度
*/
#define NavigationHeight 64
/**
* 屏幕的物理宽度
*/
#define ScreenWidth [UIScreen mainScreen].bounds.size.width
/**
* 定义UIImage对象
*/
#define TCImage(imageName) [UIImage imageNamed:[NSString stringWithFormat:@"%@",imageName]]
/**
* 默认显示头像
*/
#define ReplaceImage [UIImage imageNamed:@"矢量智能对象"]
/**
* AppDelegate代理
*/
#define SHARED_APPDELEGATE ((AppDelegate *)([UIApplication sharedApplication].delegate))
/**
* 屏幕的物理高度
......@@ -134,14 +125,14 @@
/**
* 服务器开发地址
* 服务器测试地址
*/
#define ServerAddress @"http://dg-dev.opple.com/opple-web/app"
//#define ServerAddress @"http://dg-dev.opple.com/opple-web/app"
/**
* 服务器测试地址
* 服务器开发地址
*/
//#define ServerAddress @"http://139.196.195.30:8090/opple-web/app"
#define ServerAddress @"http://139.196.195.30:8090/opple-web/app"
/**
......@@ -187,7 +178,7 @@
/**
* 网络请求返回个数
*/
#define KROWS 10
#define KROWS 12
#define RGB(A, B, C, D) [UIColor colorWithRed:(A)/255.0 green:(B)/255.0 blue:(C)/255.0 alpha:(D)]
......
......@@ -236,7 +236,6 @@
//场景筛选条件
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/scene/getSceneFilter"] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) {
SceneFilter *filterModel = [[SceneFilter alloc]initWithDictionary:returnValue[@"data"] error:nil];
......@@ -414,12 +413,10 @@
[weakSelf.productScreeningDatasArray removeAllObjects];
}
GoodsFilter *goodsScreening = [[GoodsFilter alloc]initWithDictionary:returnValue[@"data"] error:nil];
for (int i=0; i<5; i++) {
NSMutableArray *array = [NSMutableArray array];
[weakSelf.productScreeningDatasArray addObject:array];
}
for (DataDict *model in goodsScreening.styles) {
DataDictModel *newModel = [[DataDictModel alloc]init];
newModel.typename = model.typename;
......@@ -476,7 +473,6 @@
#pragma mark -获取商品列表数据
- (void)getGoodsListDatasisRemove:(BOOL)remove Withobject:(GoodsCondition *)conditon
{
__weak typeof(self)weakSelf = self;
[self getGoodsListdatas:conditon returnResponse:^(GoodsResponse *response) {
......@@ -547,7 +543,6 @@
__weak typeof(self) weakSelf = self;
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/goods/query"] WithRequestType:0 WithParameter:conditon WithReturnValueBlock:^(id returnValue) {
[weakSelf endRefreshingForTableView:weakSelf.sceneOrProductClollectionView];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
......@@ -603,7 +598,8 @@
ScreeningTableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.screeningLabe.backgroundColor = kTCColor(221, 221, 221);
cell.screeningLabe.textColor = kMainBlueColor;
self.goodsModel.categoryEquals = [[[self.productScreeningDatasArray objectAtIndex_opple:self.rightSelectedIndex] objectAtIndex_opple:indexPath.row] fid];
GoodsCategoryModel *model = [[self.productScreeningDatasArray objectAtIndex_opple:self.rightSelectedIndex] objectAtIndex_opple:indexPath.section];
self.goodsModel.categoryEquals = [[model.children objectAtIndex_opple:indexPath.row] fid];
[self.sceneOrProductClollectionView.mj_header beginRefreshing];
}
......@@ -644,7 +640,6 @@
#pragma mark -区头选中
- (void)SectionButtonClickAction:(UIButton *)button
{
[self CancelTableviewSectionState];
if (self.rightSelectedIndex !=2 ) {
button.selected = YES;
......@@ -982,15 +977,13 @@
#pragma mark -搜索框
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
[textField resignFirstResponder];
[self emptyModel];
[textField resignFirstResponder];
self.goodsModel.nameLike = textField.text;
[self.sceneOrProductClollectionView.mj_header beginRefreshing];
return YES;
}
#pragma mark -返回手势
- (void)ReturnDismiss
{
......@@ -1012,7 +1005,6 @@
#pragma mark -清空模型
- (void)emptyModel
{
self.searchProductField.text = nil;
self.goodsModel.nameLike = nil;
self.goodsModel.styleEquals = nil;
self.goodsModel.spaceEquals = nil;
......@@ -1023,13 +1015,11 @@
}
- (void)dealloc
{
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
[[SDImageCache sharedImageCache] clearDisk];
NSLog(@"结算到内存警告");
// Dispose of any resources that can be recreated.
}
......
......@@ -29,7 +29,8 @@
[self dismissViewControllerAnimated:YES completion:nil];
NSData *imageData = UIImageJPEGRepresentation(self.shareImage, 0.5);
NSDictionary *parameterDict = [NSDictionary dictionaryWithObjectsAndKeys:[self.goodsIds substringToIndex:self.goodsIds.length-2],@"goodsIds",@"",@"title",@"",@"remark",nil];
NSString *goodsID = [self.goodsIds substringToIndex:[self.goodsIds length]-1];
NSDictionary *parameterDict = [NSDictionary dictionaryWithObjectsAndKeys:[goodsID substringToIndex:self.goodsIds.length-2],@"goodsIds",@"",@"title",@"",@"remark",nil];
//上传图片
[[NetworkRequestClassManager Manager] UploadImageWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/system/shareGoods"] WithRequestType:0 WithImageDatas:imageData WithParameter:parameterDict WithReturnValueBlock:^(id returnValue) {
......
......@@ -2164,6 +2164,13 @@ extern NSString * const SORTDIRECTION_DESC;
*
*/
@property (nonatomic, copy) NSString *username;
/**
* 短信验证码,请先调用发送短信接口
* com.gomore.opple.rest.system.RsSystemService#sendSms(String)
*
*
*/
@property (nonatomic, copy) NSString *smsCode;
/**
* 新密码
*
......@@ -2349,7 +2356,7 @@ extern NSString * const SORTDIRECTION_DESC;
*
*
*/
@property (nonatomic, strong) NSData *signature;
@property (nonatomic, copy) NSData *signature;
/**
* (no documentation provided)
*
......
......@@ -726,6 +726,7 @@ NSString * const SORTDIRECTION_DESC = @"desc";
@implementation ResetPasswordRequest
@synthesize username;
@synthesize smsCode;
@synthesize fnewPassword;
+(BOOL)propertyIsOptional:(NSString*)propertyName
......
......@@ -13,5 +13,6 @@ pod 'AFNetworking', '~> 3.1.0'
pod 'JSONModel', '~> 1.2.0'
pod 'UMengSocial', '~> 5.0'
pod 'DZNEmptyDataSet', '~> 1.8.1'
pod 'Bugly', '~> 2.2.3'
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