Commit e23d89d0 authored by 勾芒's avatar 勾芒

优化筛选商品,接入短信验证码重置密码

parent 125a1f71
...@@ -51,6 +51,16 @@ ...@@ -51,6 +51,16 @@
*/ */
@property (nonatomic,copy) NSString *passWordString; @property (nonatomic,copy) NSString *passWordString;
/**
* companyName
*/
@property (weak, nonatomic) IBOutlet UIImageView *companyName;
/**
* 背景大图
*/
@property (weak, nonatomic) IBOutlet UIImageView *backImageView;
@end @end
...@@ -94,6 +104,7 @@ ...@@ -94,6 +104,7 @@
self.passWordString = [[NSUserDefaults standardUserDefaults] objectForKey:PASSWORD]; self.passWordString = [[NSUserDefaults standardUserDefaults] objectForKey:PASSWORD];
self.userName.text = self.userNameString; self.userName.text = self.userNameString;
self.passWord.text = self.passWordString; self.passWord.text = self.passWordString;
} }
...@@ -184,10 +195,11 @@ ...@@ -184,10 +195,11 @@
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
[self ErrorMBProgressView:@"网络中"]; [self ErrorMBProgressView:@"网络中"];
} WithFailureBlock:^(id error) { } WithFailureBlock:^(NSError *error) {
[self ErrorMBProgressView:error.localizedDescription];
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
}]; }];
...@@ -254,7 +266,6 @@ ...@@ -254,7 +266,6 @@
self.passWord.text = @""; self.passWord.text = @"";
return; return;
} }
self.identityView.layer.masksToBounds = YES; self.identityView.layer.masksToBounds = YES;
self.identityView.layer.cornerRadius = 10; self.identityView.layer.cornerRadius = 10;
[self.identityView.backLoginButton addTarget:self action:@selector(BackloginButtonClick) forControlEvents:UIControlEventTouchUpInside]; [self.identityView.backLoginButton addTarget:self action:@selector(BackloginButtonClick) forControlEvents:UIControlEventTouchUpInside];
...@@ -266,7 +277,6 @@ ...@@ -266,7 +277,6 @@
[UIView animateWithDuration:0.2 animations:^{ [UIView animateWithDuration:0.2 animations:^{
self.identityView.alpha = 1; self.identityView.alpha = 1;
}]; }];
} }
...@@ -284,33 +294,40 @@ ...@@ -284,33 +294,40 @@
[self ErrorMBProgressView:@"手机号码格式不正确"]; [self ErrorMBProgressView:@"手机号码格式不正确"];
return; return;
} }
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
//发送验证码 //发送验证码
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/system/sendSms"] WithRequestType:0 WithParameter:[NSDictionary dictionaryWithObjectsAndKeys:inputPhoneNumber,@"mobilephone", nil] WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@%@",ServerAddress,@"/sendSms/send?phone=",inputPhoneNumber] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
//解析返回的验证码,并存储到变量 [self RemoveMBProgressHUDLoding];
// NSLog(@"%@",returnValue); if ([returnValue[@"code"] isEqualToNumber:@0]) {
self.verifyCode = @"1234";
if ([[returnValue[@"data"] lastObject] isEqualToString:@"发送短信成功"]) {
[self ErrorMBProgressView:@"发送验证码成功"];
self.verifyCode = [returnValue[@"data"] firstObject];
[self.identityView.SendButton setTitle:@"60" forState:UIControlStateNormal];
self.identityView.SendButton.enabled = NO;
self.sendTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(SendbuttonChangetitle) userInfo:nil repeats:YES];
}else
{
[self ErrorMBProgressView:[returnValue[@"data"] lastObject]];
}
[self RemoveMBProgressHUDLoding]; }else
{
[self ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
[self ErrorMBProgressView:@"网络中断"];
[self RemoveMBProgressHUDLoding];
} WithFailureBlock:^(NSError *error) {
} WithFailureBlock:^(id error) { [self ErrorMBProgressView:error.localizedDescription];
// NSLog(@"%@",error);
self.verifyCode = @"1234";
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
}]; }];
[self.identityView.SendButton setTitle:@"60" forState:UIControlStateNormal];
self.identityView.SendButton.enabled = NO;
self.sendTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(SendbuttonChangetitle) userInfo:nil repeats:YES];
} }
#pragma mark -倒计时 #pragma mark -倒计时
...@@ -401,21 +418,21 @@ ...@@ -401,21 +418,21 @@
[self ErrorMBProgressView:@"两次密码不相同"]; [self ErrorMBProgressView:@"两次密码不相同"];
return; return;
} }
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
//重置密码接口 //重置密码接口
ResetPasswordRequest *passwrod = [[ResetPasswordRequest alloc]init]; ResetPasswordRequest *passwrod = [[ResetPasswordRequest alloc]init];
passwrod.fnewPassword = @"123456"; passwrod.fnewPassword = self.resetPasswordView.newpass.text;
passwrod.username = @"sh1"; passwrod.username = self.userName.text;
passwrod.smsCode = @"1234";//验证码 passwrod.smsCode = self.verifyCode;//验证码
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/employee/resetPassword"] WithRequestType:0 WithParameter:passwrod WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/employee/resetPassword"] WithRequestType:0 WithParameter:passwrod WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding]; // [self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
[self ErrorMBProgressView:returnValue[@"message"]]; [self ErrorMBProgressView:@"重置密码成功"];
self.passWord.text = self.resetPasswordView.newpass.text;
[self judgeUserNameAndPassword];
}else }else
{ {
[self ErrorMBProgressView:returnValue[@"message"]]; [self ErrorMBProgressView:returnValue[@"message"]];
...@@ -423,8 +440,9 @@ ...@@ -423,8 +440,9 @@
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) { } WithFailureBlock:^(NSError *error) {
[self ErrorMBProgressView:error.localizedDescription];
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
}]; }];
......
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
<rect key="frame" x="192" y="0.0" width="78" height="40"/> <rect key="frame" x="192" y="0.0" width="78" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/> <fontDescription key="fontDescription" type="system" pointSize="16"/>
<inset key="titleEdgeInsets" minX="25" minY="0.0" maxX="0.0" maxY="0.0"/>
<state key="normal" title="发送"> <state key="normal" title="发送">
<color key="titleColor" red="0.34901960784313724" green="0.67450980392156867" blue="0.86274509803921573" alpha="1" colorSpace="calibratedRGB"/> <color key="titleColor" red="0.34901960784313724" green="0.67450980392156867" blue="0.86274509803921573" alpha="1" colorSpace="calibratedRGB"/>
</state> </state>
...@@ -58,7 +59,7 @@ ...@@ -58,7 +59,7 @@
<rect key="frame" x="40" y="0.0" width="230" height="40"/> <rect key="frame" x="40" y="0.0" width="230" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/> <color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/> <fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/> <textInputTraits key="textInputTraits"/>
</textField> </textField>
...@@ -133,12 +134,12 @@ ...@@ -133,12 +134,12 @@
<rect key="frame" x="25" y="67" width="270" height="40"/> <rect key="frame" x="25" y="67" width="270" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews> <subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="新密码" textAlignment="natural" minimumFontSize="17" id="DSk-gL-shj"> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="新密码" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" id="DSk-gL-shj">
<rect key="frame" x="40" y="0.0" width="230" height="40"/> <rect key="frame" x="40" y="0.0" width="230" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/> <fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/> <textInputTraits key="textInputTraits" secureTextEntry="YES"/>
</textField> </textField>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Lock-0" id="4iz-jt-vDx"> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Lock-0" id="4iz-jt-vDx">
<rect key="frame" x="10" y="13" width="15" height="15"/> <rect key="frame" x="10" y="13" width="15" height="15"/>
...@@ -160,12 +161,12 @@ ...@@ -160,12 +161,12 @@
<rect key="frame" x="25" y="135" width="270" height="40"/> <rect key="frame" x="25" y="135" width="270" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews> <subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="确认新密码" textAlignment="natural" minimumFontSize="17" id="Q11-cX-wBJ"> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="确认新密码" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" id="Q11-cX-wBJ">
<rect key="frame" x="40" y="0.0" width="230" height="40"/> <rect key="frame" x="40" y="0.0" width="230" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/> <fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/> <textInputTraits key="textInputTraits" secureTextEntry="YES"/>
</textField> </textField>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Lock-0" id="7gP-am-if6"> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Lock-0" id="7gP-am-if6">
<rect key="frame" x="10" y="12" width="15" height="15"/> <rect key="frame" x="10" y="12" width="15" height="15"/>
......
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
}else if (indexPath.section == 1) }else if (indexPath.section == 1)
{ {
goodsDetailsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"goodsdetailscell" forIndexPath:indexPath]; goodsDetailsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"goodsdetailscell" forIndexPath:indexPath];
[cell.detailsImageView sd_setImageWithURL:[NSURL URLWithString:[self.goodsDetailsArray objectAtIndex_opple:indexPath.row]] placeholderImage:REPLACEIMAGE]; [cell.detailsImageView sd_setImageWithURL:[NSURL URLWithString:[self.goodsDetailsArray objectAtIndex_opple:indexPath.row]] placeholderImage:TCImage(@"bg-big")];
return cell; return cell;
} }
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
return 170; return 170;
} }
return ScreenWidth; return ScreenWidth*3/4;
} }
...@@ -382,7 +382,7 @@ ...@@ -382,7 +382,7 @@
SaveShoppingCartRequest *shopCar = [[SaveShoppingCartRequest alloc]init]; SaveShoppingCartRequest *shopCar = [[SaveShoppingCartRequest alloc]init];
shopCar.consumerId = [[Customermanager manager] customerID]; shopCar.consumerId = [[Customermanager manager] customerID];
shopCar.goodsId = _goodsID; shopCar.goodsId = _goodsID;
shopCar.count = [self.headerView.goodsNumber.text intValue]; shopCar.count = self.headerView.goodsNumber.text;
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/shopcart/save"] WithRequestType:0 WithParameter:shopCar WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/shopcart/save"] WithRequestType:0 WithParameter:shopCar WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
......
...@@ -67,6 +67,11 @@ ...@@ -67,6 +67,11 @@
*/ */
@property (nonatomic,assign) int totalPages; @property (nonatomic,assign) int totalPages;
/**
* 筛选模型
*/
@property (nonatomic,strong) GoodsCondition *condtionModel;
...@@ -101,6 +106,16 @@ ...@@ -101,6 +106,16 @@
} }
/**
* 初始化复选模型
*/
- (GoodsCondition *)condtionModel
{
if (!_condtionModel) {
_condtionModel = [[GoodsCondition alloc]init];
}
return _condtionModel;
}
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
...@@ -232,22 +247,19 @@ ...@@ -232,22 +247,19 @@
}else }else
{ {
//默认数据
GoodsCondition *conditon = [[GoodsCondition alloc]init];
//分页数据 //分页数据
DataPage *Newpage = [[DataPage alloc]init]; DataPage *Newpage = [[DataPage alloc]init];
Newpage.page = 1; Newpage.page = 1;
Newpage.rows = KROWS; Newpage.rows = KROWS;
conditon.page = Newpage; self.condtionModel.page = Newpage;
self.indexPage = 1; self.indexPage = 1;
//搜索 //搜索
if (_selectedCode) { if (_selectedCode) {
conditon.categoryEquals = _selectedCode; self.condtionModel.categoryEquals = _selectedCode;
conditon.nameLike = _selectedCode;
} }
[self.productCollectionView.mj_footer resetNoMoreData]; [self.productCollectionView.mj_footer resetNoMoreData];
[self getScreeningdatasisRemoveArray:YES]; [self getScreeningdatasisRemoveArray:YES];
[self getGoodsListDatasisRemove:YES Withobject:conditon]; [self getGoodsListDatasisRemove:YES Withobject:self.condtionModel];
} }
}]; }];
headerRefresh.stateLabel.hidden = YES; headerRefresh.stateLabel.hidden = YES;
...@@ -265,23 +277,21 @@ ...@@ -265,23 +277,21 @@
}else }else
{ {
//默认数据
GoodsCondition *conditon = [[GoodsCondition alloc]init];
//分页数据
DataPage *Newpage = [[DataPage alloc]init];
if (self.indexPage ++ > self.totalPages) { if (self.indexPage ++ > self.totalPages) {
[self.productCollectionView.mj_footer endRefreshingWithNoMoreData]; [self.productCollectionView.mj_footer endRefreshingWithNoMoreData];
}else }else
{ {
//分页数据
DataPage *Newpage = [[DataPage alloc]init];
Newpage.page = self.indexPage ++; Newpage.page = self.indexPage ++;
Newpage.rows = KROWS; Newpage.rows = KROWS;
conditon.page = Newpage; self.condtionModel.page = Newpage;
//搜索 //搜索
if (_selectedCode) { if (_selectedCode) {
conditon.categoryEquals = _selectedCode; self.condtionModel.categoryEquals = _selectedCode;
conditon.nameLike = _selectedCode;
} }
[self getGoodsListDatasisRemove:NO Withobject:conditon]; [self getGoodsListDatasisRemove:NO Withobject:self.condtionModel];
} }
} }
}]; }];
...@@ -294,6 +304,7 @@ ...@@ -294,6 +304,7 @@
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@%@",ServerAddress,@"/goods/getGoodsByCode/",_barcode] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@%@",ServerAddress,@"/goods/getGoodsByCode/",_barcode] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[self endRefreshingForTableView:self.productCollectionView];
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -309,12 +320,14 @@ ...@@ -309,12 +320,14 @@
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
[self endRefreshingForTableView:self.productCollectionView];
[self ErrorMBProgressView:@"网络连接中断"]; [self ErrorMBProgressView:@"网络连接中断"];
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
} WithFailureBlock:^(id error) { } WithFailureBlock:^(id error) {
[self ErrorMBProgressView:@"查询失败"]; [self ErrorMBProgressView:@"查询失败"];
[self endRefreshingForTableView:self.productCollectionView];
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
}]; }];
} }
...@@ -379,7 +392,6 @@ ...@@ -379,7 +392,6 @@
}]; }];
[weakSelf StartAddShoppingCarAnimationWithimage:weakCell.productImageView.image withStartpoint:centerPoint]; [weakSelf StartAddShoppingCarAnimationWithimage:weakCell.productImageView.image withStartpoint:centerPoint];
}]; }];
return cell; return cell;
} }
...@@ -459,7 +471,6 @@ ...@@ -459,7 +471,6 @@
- (void)ScreeningButtonClick - (void)ScreeningButtonClick
{ {
self.screenView = [[[NSBundle mainBundle] loadNibNamed:@"ScreeningView" owner:self options:nil]firstObject]; self.screenView = [[[NSBundle mainBundle] loadNibNamed:@"ScreeningView" owner:self options:nil]firstObject];
self.screenView.frame = CGRectMake(0, 0, ScreenWidth, ScreenHeight); self.screenView.frame = CGRectMake(0, 0, ScreenWidth, ScreenHeight);
self.screenView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5]; self.screenView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
...@@ -556,22 +567,8 @@ ...@@ -556,22 +567,8 @@
- (void)selectedItem:(NSString *)typecode - (void)selectedItem:(NSString *)typecode
{ {
[self DismissScreenView]; [self DismissScreenView];
GoodsCondition *condition = [[GoodsCondition alloc]init]; self.selectedCode = typecode;
DataPage *page = [[DataPage alloc]init]; [self.productCollectionView.mj_header beginRefreshing];
page.page = 0;
condition.page = page;
condition.categoryEquals = typecode;
//分类模块筛选
__weak typeof(self)Weakself = self;
[self getGoodsListdatas:condition returnResponse:^(GoodsResponse *response) {
Weakself.datasArray = [NSMutableArray arrayWithArray:response.goodsEntity];
[Weakself.productCollectionView reloadData];
if (response.goodsEntity.count == 0) {
[self ErrorMBProgressView:@"暂无数据"];
}
}];
} }
...@@ -597,7 +594,8 @@ ...@@ -597,7 +594,8 @@
GoodsCondition *condition = [[GoodsCondition alloc]init]; GoodsCondition *condition = [[GoodsCondition alloc]init];
DataPage *page = [[DataPage alloc]init]; DataPage *page = [[DataPage alloc]init];
page.page = 0; page.rows = 10;
page.page = 1;
condition.page = page; condition.page = page;
if (styleCode.length != 0) { if (styleCode.length != 0) {
condition.styleEquals = styleCode; condition.styleEquals = styleCode;
...@@ -618,6 +616,16 @@ ...@@ -618,6 +616,16 @@
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.categoryEquals = condition.categoryEquals;
self.condtionModel.spaceEquals = condition.spaceEquals;
self.condtionModel.materialEqueals = condition.materialEqueals;
self.condtionModel.startprice = condition.startprice;
self.condtionModel.endprice = condition.endprice;
self.selectedCode = nil;//清空单选
// [self.productCollectionView.mj_header beginRefreshing];
__weak typeof (self) Weakself = self; __weak typeof (self) Weakself = self;
[self getGoodsListdatas:condition returnResponse:^(GoodsResponse *response) { [self getGoodsListdatas:condition returnResponse:^(GoodsResponse *response) {
...@@ -652,7 +660,6 @@ ...@@ -652,7 +660,6 @@
}completion:^(BOOL finished) { }completion:^(BOOL finished) {
[self.screenView removeFromSuperview]; [self.screenView removeFromSuperview];
}]; }];
} }
...@@ -683,7 +690,7 @@ ...@@ -683,7 +690,7 @@
SaveShoppingCartRequest *shopCar = [[SaveShoppingCartRequest alloc]init]; SaveShoppingCartRequest *shopCar = [[SaveShoppingCartRequest alloc]init];
shopCar.consumerId = [[Customermanager manager] customerID]; shopCar.consumerId = [[Customermanager manager] customerID];
shopCar.goodsId = model.fid; shopCar.goodsId = model.fid;
shopCar.count = 1; shopCar.count = @"1";
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/shopcart/save"] WithRequestType:0 WithParameter:shopCar WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/shopcart/save"] WithRequestType:0 WithParameter:shopCar WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -697,7 +704,6 @@ ...@@ -697,7 +704,6 @@
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) { } WithFailureBlock:^(id error) {
[self ErrorMBProgressView:@"加入购物车失败"]; [self ErrorMBProgressView:@"加入购物车失败"];
}]; }];
......
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{ {
[tableView deselectRowAtIndexPath:indexPath animated:YES]; // [tableView deselectRowAtIndexPath:indexPath animated:YES];
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
if ([cell.textLabel.text isEqualToString:@"客户管理"] ) { if ([cell.textLabel.text isEqualToString:@"客户管理"] ) {
......
...@@ -231,6 +231,7 @@ ...@@ -231,6 +231,7 @@
#pragma mark -切换显示风格 #pragma mark -切换显示风格
- (IBAction)SwitchdisplayStyleClick:(UIButton *)sender { - (IBAction)SwitchdisplayStyleClick:(UIButton *)sender {
[self dismissViewControllerAnimated:NO completion:nil];
[self ShowPopoverViewController:CGSizeMake(55, 180) Withdatas:self.imageArray ShowButton:sender SelectedIndex:100]; [self ShowPopoverViewController:CGSizeMake(55, 180) Withdatas:self.imageArray ShowButton:sender SelectedIndex:100];
} }
...@@ -238,8 +239,13 @@ ...@@ -238,8 +239,13 @@
#pragma mark -筛选风格 #pragma mark -筛选风格
- (void)screeningStyleButtonClick:(UIButton *)sender { - (void)screeningStyleButtonClick:(UIButton *)sender {
NSMutableArray *styleArray = [NSMutableArray arrayWithArray:self.filter.styles];
DataDict *style = [[DataDict alloc]init];
style.typename = @"全部";
[styleArray insertObject:style atIndex:0];
[self dismissViewControllerAnimated:NO completion:nil]; [self dismissViewControllerAnimated:NO completion:nil];
[self ShowPopoverViewController:CGSizeMake(150, 200) Withdatas:self.filter.styles ShowButton:sender SelectedIndex:0]; [self ShowPopoverViewController:CGSizeMake(150, 200) Withdatas:styleArray ShowButton:sender SelectedIndex:0];
} }
...@@ -247,8 +253,12 @@ ...@@ -247,8 +253,12 @@
#pragma mark -空间风格 #pragma mark -空间风格
- (void)HouseStyleButtonClick:(UIButton *)sender { - (void)HouseStyleButtonClick:(UIButton *)sender {
NSMutableArray *spaceArray = [NSMutableArray arrayWithArray:self.filter.space];
DataDict *space = [[DataDict alloc]init];
space.typename = @"全部";
[spaceArray insertObject:space atIndex:0];
[self dismissViewControllerAnimated:NO completion:nil]; [self dismissViewControllerAnimated:NO completion:nil];
[self ShowPopoverViewController:CGSizeMake(150, 200) Withdatas:self.filter.space ShowButton:sender SelectedIndex:1]; [self ShowPopoverViewController:CGSizeMake(150, 200) Withdatas:spaceArray ShowButton:sender SelectedIndex:1];
} }
...@@ -279,7 +289,7 @@ ...@@ -279,7 +289,7 @@
[self dismissViewControllerAnimated:YES completion:nil]; [self dismissViewControllerAnimated:YES completion:nil];
SceneCondition *condition = [[SceneCondition alloc]init]; SceneCondition *condition = [[SceneCondition alloc]init];
DataPage *page = [[DataPage alloc]init]; DataPage *page = [[DataPage alloc]init];
page.page = 0; page.page = 1;
condition.page = page; condition.page = page;
//空间code //空间code
......
...@@ -8,6 +8,16 @@ ...@@ -8,6 +8,16 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
/**
* 选中cell回调
*/
@protocol ButtonClickActiondelegate <NSObject>
- (void)SelectedButtonClickAction:(NSIndexPath *)indexpath;
@end
@interface ScreeningFirstCollectionViewCell : UICollectionViewCell @interface ScreeningFirstCollectionViewCell : UICollectionViewCell
...@@ -15,7 +25,15 @@ ...@@ -15,7 +25,15 @@
/** /**
* 显示的labe * 显示的labe
*/ */
@property (nonatomic,strong) UILabel *titleLabe; @property (nonatomic,strong) UIButton *titleLabe;
/**
* cell下标信息
*/
@property (nonatomic,strong) NSIndexPath *indexpath;
@property (nonatomic,strong)id<ButtonClickActiondelegate>delegate;
@end @end
...@@ -25,17 +25,28 @@ ...@@ -25,17 +25,28 @@
- (void)uiConfigAction - (void)uiConfigAction
{ {
self.contentView.layer.masksToBounds = YES;
self.contentView.layer.cornerRadius = kCornerRadius; self.titleLabe = [UIButton buttonWithType:UIButtonTypeCustom];
self.contentView.layer.borderWidth = 1; self.titleLabe.frame = self.contentView.frame;
self.contentView.layer.borderColor = kMainBlueColor.CGColor; [self.titleLabe setTitleColor:kMainBlueColor forState:UIControlStateNormal];
self.titleLabe = [[UILabel alloc]initWithFrame:self.contentView.bounds]; [self.titleLabe setBackgroundImage:TCImage(@"kamincolor") forState:UIControlStateHighlighted];
self.titleLabe.textColor = kMainBlueColor; [self.titleLabe setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted];
self.titleLabe.font = [UIFont systemFontOfSize:12]; self.titleLabe.titleLabel.font = [UIFont systemFontOfSize:12];
self.titleLabe.textAlignment = NSTextAlignmentCenter;
[self.contentView addSubview:self.titleLabe]; [self.contentView addSubview:self.titleLabe];
[self.titleLabe addTarget:self action:@selector(ButtonClick) forControlEvents:UIControlEventTouchUpInside];
self.titleLabe.layer.masksToBounds = YES;
self.titleLabe.layer.cornerRadius = kCornerRadius;
self.titleLabe.layer.borderWidth = 1;
self.titleLabe.layer.borderColor = kMainBlueColor.CGColor;
} }
#pragma mark -点击
- (void)ButtonClick
{
if ([self.delegate respondsToSelector:@selector(SelectedButtonClickAction:)]) {
[self.delegate SelectedButtonClickAction:_indexpath];
}
}
@end @end
...@@ -8,6 +8,10 @@ ...@@ -8,6 +8,10 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
@interface ScreeningSecondCollectionReusableView : UICollectionReusableView @interface ScreeningSecondCollectionReusableView : UICollectionReusableView
...@@ -24,4 +28,6 @@ ...@@ -24,4 +28,6 @@
@property (nonatomic,strong) UIButton *subTitleButton; @property (nonatomic,strong) UIButton *subTitleButton;
@end @end
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#define WIDTH self.frame.size.width #define WIDTH self.frame.size.width
#define HEIGHT self.frame.size.height
@implementation ScreeningSecondCollectionReusableView @implementation ScreeningSecondCollectionReusableView
...@@ -27,14 +28,19 @@ ...@@ -27,14 +28,19 @@
#pragma mark -UI #pragma mark -UI
- (void)uiConfigAction - (void)uiConfigAction
{ {
self.alltitleButton = [UIButton buttonWithType:UIButtonTypeSystem]; self.alltitleButton = [UIButton buttonWithType:UIButtonTypeCustom];
self.alltitleButton.layer.masksToBounds = YES; self.alltitleButton.layer.masksToBounds = YES;
self.alltitleButton.layer.cornerRadius = kCornerRadius; self.alltitleButton.layer.cornerRadius = kCornerRadius;
[self.alltitleButton setTitle:@"全部" forState:UIControlStateNormal]; [self.alltitleButton setTitle:@"全部" forState:UIControlStateNormal];
[self addSubview:self.alltitleButton]; [self addSubview:self.alltitleButton];
self.alltitleButton.titleLabel.font = [UIFont systemFontOfSize:12]; self.alltitleButton.titleLabel.font = [UIFont systemFontOfSize:12];
[self.alltitleButton setBackgroundColor:kMainBlueColor]; [self.alltitleButton setTitleColor:kMainBlueColor forState:UIControlStateNormal];
[self.alltitleButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [self.alltitleButton setBackgroundImage:TCImage(@"kamincolor") forState:UIControlStateHighlighted];
[self.alltitleButton setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted];
self.alltitleButton.layer.masksToBounds = YES;
self.alltitleButton.layer.cornerRadius = kCornerRadius;
self.alltitleButton.layer.borderWidth = 1;
self.alltitleButton.layer.borderColor = kMainBlueColor.CGColor;
[self.alltitleButton mas_makeConstraints:^(MASConstraintMaker *make) { [self.alltitleButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake((WIDTH-127)/3, 35)); make.size.mas_equalTo(CGSizeMake((WIDTH-127)/3, 35));
...@@ -42,9 +48,8 @@ ...@@ -42,9 +48,8 @@
make.top.equalTo(self.mas_top).offset(20); make.top.equalTo(self.mas_top).offset(20);
}]; }];
//副标题按钮 //副标题按钮
self.subTitleButton = [UIButton buttonWithType:UIButtonTypeSystem]; self.subTitleButton = [UIButton buttonWithType:UIButtonTypeCustom];
[self.subTitleButton setTitle:@"副标题" forState:UIControlStateNormal]; [self.subTitleButton setTitle:@"副标题" forState:UIControlStateNormal];
[self addSubview:self.subTitleButton]; [self addSubview:self.subTitleButton];
self.subTitleButton.titleLabel.font = [UIFont systemFontOfSize:12]; self.subTitleButton.titleLabel.font = [UIFont systemFontOfSize:12];
...@@ -56,7 +61,8 @@ ...@@ -56,7 +61,8 @@
make.top.equalTo(self.mas_top).offset(75); make.top.equalTo(self.mas_top).offset(75);
}]; }];
} }
@end @end
//
// SelectedTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 16/5/27.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SelectedTableViewCell : UITableViewCell
@property (nonatomic,strong) UILabel *titleLabe;
@end
//
// SelectedTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 16/5/27.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "SelectedTableViewCell.h"
@implementation SelectedTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.titleLabe = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 80, 55)];
self.titleLabe.backgroundColor = [UIColor grayColor];
self.titleLabe.font = [UIFont systemFontOfSize:13];
self.titleLabe.text = @"全部";
self.titleLabe.textColor = [UIColor whiteColor];
self.titleLabe.textAlignment = NSTextAlignmentCenter;
[self.contentView addSubview:self.titleLabe];
}
return self;
}
@end
...@@ -193,7 +193,7 @@ ...@@ -193,7 +193,7 @@
SaveShoppingCartRequest *shopCar = [[SaveShoppingCartRequest alloc]init]; SaveShoppingCartRequest *shopCar = [[SaveShoppingCartRequest alloc]init];
shopCar.consumerId = [[Customermanager manager] customerID]; shopCar.consumerId = [[Customermanager manager] customerID];
shopCar.goodsId = model.fid; shopCar.goodsId = model.fid;
shopCar.count = 1; shopCar.count = @"1";
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/shopcart/save"] WithRequestType:0 WithParameter:shopCar WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/shopcart/save"] WithRequestType:0 WithParameter:shopCar WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
......
...@@ -261,9 +261,12 @@ ...@@ -261,9 +261,12 @@
{ {
QRViewController *qrVC = [[QRViewController alloc] initWithScanCompleteHandler:^(NSString *url) { QRViewController *qrVC = [[QRViewController alloc] initWithScanCompleteHandler:^(NSString *url) {
[self dismissViewControllerAnimated:YES completion:^{
[self dismissViewControllerAnimated:YES completion:nil]; ProductLibraryViewController *product = [SHARED_APPDELEGATE.allControllerArray objectAtIndex_opple:4];
NSLog(@"%@",url); product.barcode = url;
self.selectedIndex = 4;
}];
}]; }];
[self presentViewController:qrVC animated:YES completion:nil]; [self presentViewController:qrVC animated:YES completion:nil];
} }
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "ScreeningFirstCollectionViewCell.h"
#import "ScreeningCollectionReusableView.h"
/** /**
* 选中item * 选中item
...@@ -21,7 +22,7 @@ ...@@ -21,7 +22,7 @@
@interface screeningFirstView : UIView<UICollectionViewDelegate,UICollectionViewDataSource> @interface screeningFirstView : UIView<UICollectionViewDelegate,UICollectionViewDataSource,ButtonClickActiondelegate,ButtonClickActiondelegate>
/** /**
...@@ -65,4 +66,5 @@ ...@@ -65,4 +66,5 @@
@end @end
...@@ -7,8 +7,7 @@ ...@@ -7,8 +7,7 @@
// //
#import "screeningFirstView.h" #import "screeningFirstView.h"
#import "ScreeningFirstCollectionViewCell.h"
#import "ScreeningCollectionReusableView.h"
#define WIDTH self.frame.size.width #define WIDTH self.frame.size.width
@implementation screeningFirstView @implementation screeningFirstView
...@@ -36,9 +35,6 @@ ...@@ -36,9 +35,6 @@
} }
#pragma mark -UI #pragma mark -UI
- (void)uiConfigAction - (void)uiConfigAction
{ {
...@@ -61,21 +57,20 @@ ...@@ -61,21 +57,20 @@
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{ {
ScreeningFirstCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath]; ScreeningFirstCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
cell.indexpath = indexPath;
cell.delegate = self;
if (self.selectedIndex == 1) { if (self.selectedIndex == 1) {
cell.titleLabe.text = [[[[self.datasArray objectAtIndex_opple:indexPath.section] children] objectAtIndex_opple:indexPath.row] name]; [cell.titleLabe setTitle:[[[[self.datasArray objectAtIndex_opple:indexPath.section] children] objectAtIndex_opple:indexPath.row] name] forState:UIControlStateNormal];
} }
else else
{ {
cell.titleLabe.text = [[self.datasArray objectAtIndex_opple:indexPath.row] typename]; [cell.titleLabe setTitle:[[self.datasArray objectAtIndex_opple:indexPath.row] typename] forState:UIControlStateNormal];
} }
return cell; return cell;
} }
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{ {
if (self.selectedIndex == 1) { if (self.selectedIndex == 1) {
...@@ -86,22 +81,25 @@ ...@@ -86,22 +81,25 @@
return self.datasArray.count; return self.datasArray.count;
} }
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
#pragma mark -选中代理
- (void)SelectedButtonClickAction:(NSIndexPath *)indexpath
{ {
if ([self.delegate respondsToSelector:@selector(selectedItem:)]) { if ([self.delegate respondsToSelector:@selector(selectedItem:)]) {
if (self.selectedIndex == 1 ) { if (self.selectedIndex == 1 ) {
[self.delegate selectedItem:[[[self.datasArray objectAtIndex_opple:indexPath.section] children][indexPath.row] fid]]; [self.delegate selectedItem:[[[self.datasArray objectAtIndex_opple:indexpath.section] children][indexpath.row] fid]];
}else }else
{ {
[self.delegate selectedItem:[[self.datasArray objectAtIndex_opple:indexPath.row] typecode]]; [self.delegate selectedItem:[[self.datasArray objectAtIndex_opple:indexpath.row] typecode]];
} }
} }
} }
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView
{ {
if (self.selectedIndex == 1) { if (self.selectedIndex == 1) {
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "ScreeningFirstCollectionViewCell.h"
#import "ScreeningSecondCollectionReusableView.h"
/** /**
* tableview模块的选中 * tableview模块的选中
...@@ -28,7 +29,11 @@ ...@@ -28,7 +29,11 @@
@end @end
@interface screeningSecondView : UIView<UITableViewDelegate,UITableViewDataSource,UICollectionViewDelegate,UICollectionViewDataSource>
@interface screeningSecondView : UIView<UITableViewDelegate,UITableViewDataSource,UICollectionViewDelegate,UICollectionViewDataSource,ButtonClickActiondelegate>
......
...@@ -7,9 +7,7 @@ ...@@ -7,9 +7,7 @@
// //
#import "screeningSecondView.h" #import "screeningSecondView.h"
#import "ScreeningFirstCollectionViewCell.h" #import "SelectedTableViewCell.h"
#import "ScreeningSecondCollectionReusableView.h"
#define WIDTH self.screeningCollectionView.frame.size.width #define WIDTH self.screeningCollectionView.frame.size.width
...@@ -43,18 +41,33 @@ ...@@ -43,18 +41,33 @@
- (void)setDatasArray:(NSArray *)datasArray - (void)setDatasArray:(NSArray *)datasArray
{ {
_datasArray = datasArray; _datasArray = datasArray;
[self resetCellselectedState];
SelectedTableViewCell *cell = [self.screeningTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:_selectedIndex inSection:0]];
cell.titleLabe.backgroundColor = [UIColor whiteColor];
cell.titleLabe.textColor = kMainBlueColor;
[self.screeningCollectionView reloadData]; [self.screeningCollectionView reloadData];
} }
#pragma mark -取消cell的选中状态
- (void)resetCellselectedState
{
NSArray *cellArray = [self.screeningTableview visibleCells];
for (SelectedTableViewCell *CELL in cellArray) {
CELL.titleLabe.backgroundColor = [UIColor grayColor];
CELL.titleLabe.textColor = [UIColor whiteColor];
}
}
#pragma mark - 布局 #pragma mark - 布局
- (void)uiConfigAction - (void)uiConfigAction
{ {
self.screeningTableview.delegate = self; self.screeningTableview.delegate = self;
self.screeningTableview.dataSource = self; self.screeningTableview.dataSource = self;
self.screeningTableview.tableFooterView = [UIView new]; self.screeningTableview.tableFooterView = [UIView new];
self.screeningTableview.separatorStyle = UITableViewCellSeparatorStyleNone;
self.screeningTableview.backgroundColor = [UIColor grayColor]; self.screeningTableview.backgroundColor = [UIColor grayColor];
[self.screeningTableview registerClass:[UITableViewCell class] forCellReuseIdentifier:@"tableviewcell"]; [self.screeningTableview registerClass:[SelectedTableViewCell class] forCellReuseIdentifier:@"tableviewcell"];
self.screeningLayout.itemSize = CGSizeMake((WIDTH-127)/3, 35); self.screeningLayout.itemSize = CGSizeMake((WIDTH-127)/3, 35);
self.screeningLayout.minimumLineSpacing = 30; self.screeningLayout.minimumLineSpacing = 30;
self.screeningLayout.minimumInteritemSpacing = 10; self.screeningLayout.minimumInteritemSpacing = 10;
...@@ -71,12 +84,9 @@ ...@@ -71,12 +84,9 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{ {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"tableviewcell" forIndexPath:indexPath]; SelectedTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"tableviewcell" forIndexPath:indexPath];
cell.textLabel.text = [self.defaultDatasArray objectAtIndex_opple:indexPath.row][@"typename"]; cell.titleLabe.text = [self.defaultDatasArray objectAtIndex_opple:indexPath.row][@"typename"];
cell.textLabel.font = [UIFont systemFontOfSize:10]; cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.selectedBackgroundView.backgroundColor = [UIColor whiteColor];
cell.backgroundColor = [UIColor grayColor];
cell.textLabel.textAlignment = NSTextAlignmentCenter;
return cell; return cell;
} }
...@@ -92,7 +102,10 @@ ...@@ -92,7 +102,10 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{ {
[self resetCellselectedState];
SelectedTableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.titleLabe.backgroundColor = [UIColor whiteColor];
cell.titleLabe.textColor = kMainBlueColor;
if ([self.delegate respondsToSelector:@selector(tableSelectedindex:)]) { if ([self.delegate respondsToSelector:@selector(tableSelectedindex:)]) {
[self.delegate tableSelectedindex:indexPath.row]; [self.delegate tableSelectedindex:indexPath.row];
...@@ -102,13 +115,15 @@ ...@@ -102,13 +115,15 @@
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{ {
ScreeningFirstCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath]; ScreeningFirstCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
cell.indexpath = indexPath;
cell.delegate = self;
if (self.selectedIndex == 1) { if (self.selectedIndex == 1) {
cell.titleLabe.text = [[[[self.datasArray objectAtIndex_opple:indexPath.section] children] objectAtIndex_opple:indexPath.row] name]; [cell.titleLabe setTitle:[[[[self.datasArray objectAtIndex_opple:indexPath.section] children] objectAtIndex_opple:indexPath.row] name] forState:UIControlStateNormal];
} }
else else
{ {
cell.titleLabe.text = [[self.datasArray objectAtIndex_opple:indexPath.row] typename]; [cell.titleLabe setTitle:[[self.datasArray objectAtIndex_opple:indexPath.row] typename] forState:UIControlStateNormal];
} }
return cell; return cell;
} }
...@@ -123,21 +138,43 @@ ...@@ -123,21 +138,43 @@
return self.datasArray.count; return self.datasArray.count;
} }
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView
{
if (self.selectedIndex == 1) {
return self.datasArray.count;
}
return 1;
}
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath - (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
{ {
ScreeningSecondCollectionReusableView *cell = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"screeningcell" forIndexPath:indexPath];
self.selectedIndex == 1?(cell.subTitleButton.hidden = NO):(cell.subTitleButton.hidden = YES);
[cell.alltitleButton addTarget:self action:@selector(AllButtonClick:) forControlEvents:UIControlEventTouchUpInside];
ScreeningSecondCollectionReusableView *cell = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"screeningcell" forIndexPath:indexPath];
cell.clipsToBounds = YES;
if (self.selectedIndex == 1) { if (self.selectedIndex == 1) {
NSString *subTitle = [[self.datasArray objectAtIndex_opple:indexPath.section] name]; NSString *subTitle = [[self.datasArray objectAtIndex_opple:indexPath.section] name];
[cell.subTitleButton setTitle:subTitle forState:UIControlStateNormal]; [cell.subTitleButton setTitle:subTitle forState:UIControlStateNormal];
if (indexPath.section != 0) {
[cell.alltitleButton setTitle:subTitle forState:UIControlStateNormal];
cell.alltitleButton.layer.masksToBounds = NO;
cell.alltitleButton.layer.borderWidth = 0;
cell.alltitleButton.enabled = NO;
}else
{
[cell.alltitleButton setTitle:@"全部" forState:UIControlStateNormal];
cell.alltitleButton.layer.masksToBounds = YES;
cell.alltitleButton.layer.borderWidth = 1;
cell.alltitleButton.enabled = YES;
}
}else
{
[cell.alltitleButton setTitle:@"全部" forState:UIControlStateNormal];
cell.alltitleButton.layer.masksToBounds = YES;
cell.alltitleButton.layer.borderWidth = 1;
cell.alltitleButton.enabled = YES;
} }
return cell; return cell;
} }
...@@ -152,38 +189,45 @@ ...@@ -152,38 +189,45 @@
} }
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
#pragma mark -选中回调
- (void)SelectedButtonClickAction:(NSIndexPath *)indexpath
{ {
//选中后的tableview赋值,并传递typecode筛选商品 //选中后的tableview赋值,并传递typecode筛选商品
UITableViewCell *cell = [self.screeningTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:self.selectedIndex inSection:0]]; SelectedTableViewCell *cell = [self.screeningTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:self.selectedIndex inSection:0]];
//选中类型的文本 //选中类型的文本
NSString *selectedTitle = nil; NSString *selectedTitle = nil;
//选中的key //选中的key
NSString *selectedTypecode = nil; NSString *selectedTypecode = nil;
if (self.selectedIndex == 1) { if (self.selectedIndex == 1) {
selectedTitle = [[[[self.datasArray objectAtIndex_opple:indexPath.section] children] objectAtIndex_opple:indexPath.row] name]; selectedTitle = [[[[self.datasArray objectAtIndex_opple:indexpath.section] children] objectAtIndex_opple:indexpath.row] name];
selectedTypecode = [[[[self.datasArray objectAtIndex_opple:indexPath.section] children] objectAtIndex_opple:indexPath.row] fid]; selectedTypecode = [[[[self.datasArray objectAtIndex_opple:indexpath.section] children] objectAtIndex_opple:indexpath.row] fid];
} }
else else
{ {
selectedTitle = [[self.datasArray objectAtIndex_opple:indexPath.row] typename]; selectedTitle = [[self.datasArray objectAtIndex_opple:indexpath.row] typename];
selectedTypecode = [[self.datasArray objectAtIndex_opple:indexPath.row] typecode]; selectedTypecode = [[self.datasArray objectAtIndex_opple:indexpath.row] typecode];
} }
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:selectedTitle,@"typename",selectedTypecode,@"typecode", nil]; NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:selectedTitle,@"typename",selectedTypecode,@"typecode", nil];
[self.defaultDatasArray replaceObjectAtIndex:self.selectedIndex withObject:dict]; [self.defaultDatasArray replaceObjectAtIndex:self.selectedIndex withObject:dict];
cell.textLabel.text = selectedTitle; cell.titleLabe.text = selectedTitle;
[self JudgeDelegateIsPerformWithPassParamater]; [self JudgeDelegateIsPerformWithPassParamater];
} }
#pragma mark -区头的全部按钮点击 #pragma mark -区头的全部按钮点击
- (void)AllButtonClick:(UIButton *)button - (void)AllButtonClick:(UIButton *)button
{ {
UITableViewCell *cell = [self.screeningTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:self.selectedIndex inSection:0]];
cell.textLabel.text = @"全部"; SelectedTableViewCell *cell = (SelectedTableViewCell *)[self.screeningTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:self.selectedIndex inSection:0]];
cell.titleLabe.text = @"全部";
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:button.currentTitle,@"typename", nil]; NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:button.currentTitle,@"typename", nil];
[self.defaultDatasArray replaceObjectAtIndex:self.selectedIndex withObject:dict]; [self.defaultDatasArray replaceObjectAtIndex:self.selectedIndex withObject:dict];
[self JudgeDelegateIsPerformWithPassParamater]; [self JudgeDelegateIsPerformWithPassParamater];
......
...@@ -111,6 +111,7 @@ ...@@ -111,6 +111,7 @@
29BFBD981CE46FDA00C238FB /* MyclientEntityModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 29BFBD971CE46FDA00C238FB /* MyclientEntityModel.m */; }; 29BFBD981CE46FDA00C238FB /* MyclientEntityModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 29BFBD971CE46FDA00C238FB /* MyclientEntityModel.m */; };
29C584E91CDA249300C6F677 /* ProductCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29C584E81CDA249200C6F677 /* ProductCollectionViewCell.m */; }; 29C584E91CDA249300C6F677 /* ProductCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29C584E81CDA249200C6F677 /* ProductCollectionViewCell.m */; };
29C584ED1CDA429500C6F677 /* ProductDetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29C584EC1CDA429500C6F677 /* ProductDetailsViewController.m */; }; 29C584ED1CDA429500C6F677 /* ProductDetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29C584EC1CDA429500C6F677 /* ProductDetailsViewController.m */; };
29CCA43C1CF7ED6100BC19DD /* SelectedTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29CCA43B1CF7ED6100BC19DD /* SelectedTableViewCell.m */; };
29D260F51CEEAE2800A9787D /* FullScreenViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D260F41CEEAE2800A9787D /* FullScreenViewController.m */; }; 29D260F51CEEAE2800A9787D /* FullScreenViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D260F41CEEAE2800A9787D /* FullScreenViewController.m */; };
29D260F81CEEAF2D00A9787D /* FullScreenViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D260F71CEEAF2D00A9787D /* FullScreenViewCell.m */; }; 29D260F81CEEAF2D00A9787D /* FullScreenViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D260F71CEEAF2D00A9787D /* FullScreenViewCell.m */; };
29D260FB1CEECDFF00A9787D /* goodsDetailsTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D260FA1CEECDFF00A9787D /* goodsDetailsTableViewCell.m */; }; 29D260FB1CEECDFF00A9787D /* goodsDetailsTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D260FA1CEECDFF00A9787D /* goodsDetailsTableViewCell.m */; };
...@@ -327,6 +328,8 @@ ...@@ -327,6 +328,8 @@
29C584E81CDA249200C6F677 /* ProductCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProductCollectionViewCell.m; sourceTree = "<group>"; }; 29C584E81CDA249200C6F677 /* ProductCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProductCollectionViewCell.m; sourceTree = "<group>"; };
29C584EB1CDA429500C6F677 /* ProductDetailsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProductDetailsViewController.h; sourceTree = "<group>"; }; 29C584EB1CDA429500C6F677 /* ProductDetailsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProductDetailsViewController.h; sourceTree = "<group>"; };
29C584EC1CDA429500C6F677 /* ProductDetailsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProductDetailsViewController.m; sourceTree = "<group>"; }; 29C584EC1CDA429500C6F677 /* ProductDetailsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProductDetailsViewController.m; sourceTree = "<group>"; };
29CCA43A1CF7ED6100BC19DD /* SelectedTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectedTableViewCell.h; sourceTree = "<group>"; };
29CCA43B1CF7ED6100BC19DD /* SelectedTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SelectedTableViewCell.m; sourceTree = "<group>"; };
29D260F31CEEAE2800A9787D /* FullScreenViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FullScreenViewController.h; sourceTree = "<group>"; }; 29D260F31CEEAE2800A9787D /* FullScreenViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FullScreenViewController.h; sourceTree = "<group>"; };
29D260F41CEEAE2800A9787D /* FullScreenViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FullScreenViewController.m; sourceTree = "<group>"; }; 29D260F41CEEAE2800A9787D /* FullScreenViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FullScreenViewController.m; sourceTree = "<group>"; };
29D260F61CEEAF2D00A9787D /* FullScreenViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FullScreenViewCell.h; sourceTree = "<group>"; }; 29D260F61CEEAF2D00A9787D /* FullScreenViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FullScreenViewCell.h; sourceTree = "<group>"; };
...@@ -879,6 +882,8 @@ ...@@ -879,6 +882,8 @@
29834EB51CDF1EB6001A484F /* screeningSecondView.xib */, 29834EB51CDF1EB6001A484F /* screeningSecondView.xib */,
29F726021CE1E96E0072FE0E /* ScreeningSecondCollectionReusableView.h */, 29F726021CE1E96E0072FE0E /* ScreeningSecondCollectionReusableView.h */,
29F726031CE1E96E0072FE0E /* ScreeningSecondCollectionReusableView.m */, 29F726031CE1E96E0072FE0E /* ScreeningSecondCollectionReusableView.m */,
29CCA43A1CF7ED6100BC19DD /* SelectedTableViewCell.h */,
29CCA43B1CF7ED6100BC19DD /* SelectedTableViewCell.m */,
); );
name = screeningSecondView; name = screeningSecondView;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1483,6 +1488,7 @@ ...@@ -1483,6 +1488,7 @@
041636C21CF395B7008CE961 /* NSObject+UIImagePickerController.m in Sources */, 041636C21CF395B7008CE961 /* NSObject+UIImagePickerController.m in Sources */,
044CD6F11CEB81350004A715 /* ProductCollectionPictureCell.m in Sources */, 044CD6F11CEB81350004A715 /* ProductCollectionPictureCell.m in Sources */,
29BFBD8F1CE44BA900C238FB /* goodsDetailsSectionview.m in Sources */, 29BFBD8F1CE44BA900C238FB /* goodsDetailsSectionview.m in Sources */,
29CCA43C1CF7ED6100BC19DD /* SelectedTableViewCell.m in Sources */,
294CF0EC1CEDCF480055F1D8 /* PromptinformationView.m in Sources */, 294CF0EC1CEDCF480055F1D8 /* PromptinformationView.m in Sources */,
290887131CE5DF16000B7097 /* ShopcarModel.m in Sources */, 290887131CE5DF16000B7097 /* ShopcarModel.m in Sources */,
04FCB1A41CF60A8F0056093B /* DeviceDirectionManager.m in Sources */, 04FCB1A41CF60A8F0056093B /* DeviceDirectionManager.m in Sources */,
...@@ -1664,6 +1670,7 @@ ...@@ -1664,6 +1670,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer: 云霄 曹 (WM8ZU7YY98)"; CODE_SIGN_IDENTITY = "iPhone Developer: 云霄 曹 (WM8ZU7YY98)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: 云霄 曹 (WM8ZU7YY98)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: 云霄 曹 (WM8ZU7YY98)";
COMPRESS_PNG_FILES = NO; COMPRESS_PNG_FILES = NO;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = "$(inherited)"; FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SRCROOT)/Tools/PrefixHeader.pch"; GCC_PREFIX_HEADER = "$(SRCROOT)/Tools/PrefixHeader.pch";
...@@ -1719,6 +1726,7 @@ ...@@ -1719,6 +1726,7 @@
CODE_SIGN_IDENTITY = ""; CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
COMPRESS_PNG_FILES = NO; COMPRESS_PNG_FILES = NO;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = "$(inherited)"; FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SRCROOT)/Tools/PrefixHeader.pch"; GCC_PREFIX_HEADER = "$(SRCROOT)/Tools/PrefixHeader.pch";
......
...@@ -95,6 +95,8 @@ ...@@ -95,6 +95,8 @@
</view> </view>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="iPadPro"/> <simulatedScreenMetrics key="simulatedDestinationMetrics" type="iPadPro"/>
<connections> <connections>
<outlet property="backImageView" destination="bkO-7e-jCO" id="bII-uf-jVZ"/>
<outlet property="companyName" destination="bkO-7e-jCO" id="nf5-u2-fkh"/>
<outlet property="forgotPasswordButton" destination="muj-av-1uQ" id="bGD-TM-2t6"/> <outlet property="forgotPasswordButton" destination="muj-av-1uQ" id="bGD-TM-2t6"/>
<outlet property="loginButton" destination="gRP-i4-Dn9" id="td3-dH-PmD"/> <outlet property="loginButton" destination="gRP-i4-Dn9" id="td3-dH-PmD"/>
<outlet property="passWord" destination="Kpu-wY-Kir" id="bjj-yD-hPz"/> <outlet property="passWord" destination="Kpu-wY-Kir" id="bjj-yD-hPz"/>
......
{
"images" : [
{
"idiom" : "universal",
"filename" : "bg-big.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"images" : [ "images" : [
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "bg-img 副本.jpg", "filename" : "bg-img 副本.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
......
{
"images" : [
{
"idiom" : "universal",
"filename" : "kamincolor.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
hud.labelText = errorString; hud.labelText = errorString;
hud.margin = 10.f; hud.margin = 10.f;
hud.color = [[UIColor blackColor] colorWithAlphaComponent:0.5]; hud.color = [[UIColor blackColor] colorWithAlphaComponent:0.5];
hud.minSize = CGSizeMake(200, 50); hud.minSize = CGSizeMake(250, 70);
hud.animationType = MBProgressHUDAnimationZoom; hud.animationType = MBProgressHUDAnimationZoom;
hud.mode = MBProgressHUDModeText; hud.mode = MBProgressHUDModeText;
hud.removeFromSuperViewOnHide = YES; hud.removeFromSuperViewOnHide = YES;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
//定义返回数据的block类型 //定义返回数据的block类型
typedef void (^ReturnValueBlock) (id returnValue); typedef void (^ReturnValueBlock) (id returnValue);
typedef void (^ErrorCodeBlock) (id errorCodeValue); typedef void (^ErrorCodeBlock) (id errorCodeValue);
typedef void (^FailureBlock)(id error); typedef void (^FailureBlock)(NSError *error);
//定义请求类型 //定义请求类型
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
// //
#import "PDFViewController.h" #import "PDFViewController.h"
#import <WebKit/WebKit.h>
@interface PDFViewController ()<WKNavigationDelegate>
@interface PDFViewController ()<UIWebViewDelegate> @property (nonatomic,strong) WKWebView *webView;
@property (nonatomic,strong) UIWebView *webView;
@end @end
...@@ -27,11 +27,9 @@ ...@@ -27,11 +27,9 @@
#pragma mark -UI #pragma mark -UI
- (void)uiConfigAction - (void)uiConfigAction
{ {
self.webView = [[UIWebView alloc] initWithFrame:self.view.bounds]; self.webView = [[WKWebView alloc] initWithFrame:self.view.bounds];
[self.view addSubview:self.webView]; [self.view addSubview:self.webView];
self.webView.scalesPageToFit = YES; self.webView.navigationDelegate = self;
self.webView.delegate = self;
// NSString *path = [[NSBundle mainBundle] pathForResource:@"A0516052613060001" ofType:@"pdf"];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:_pdfURLString]]; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:_pdfURLString]];
[self.webView loadRequest:request]; [self.webView loadRequest:request];
[self.view addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(PDFClickAction)]]; [self.view addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(PDFClickAction)]];
...@@ -44,24 +42,22 @@ ...@@ -44,24 +42,22 @@
[self dismissViewControllerAnimated:YES completion:nil]; [self dismissViewControllerAnimated:YES completion:nil];
} }
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(null_unspecified WKNavigation *)navigation
#pragma mark -加载错误
- (void)webView:(UIWebView *)webView didFailLoadWithError:(nullable NSError *)error
{
[self ErrorMBProgressView:@"加载错误"];
[self dismissViewControllerAnimated:YES completion:nil];
}
- (void)webViewDidStartLoad:(UIWebView *)webView
{ {
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
} }
- (void)webViewDidFinishLoad:(UIWebView *)webView
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation
{ {
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
} }
- (void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error
{
[self ErrorMBProgressView:@"加载失败"];
[self dismissViewControllerAnimated:YES completion:nil];
}
......
...@@ -144,7 +144,7 @@ static NSTimeInterval kQrLineanimateDuration = 0.02; ...@@ -144,7 +144,7 @@ static NSTimeInterval kQrLineanimateDuration = 0.02;
//画四个边角 //画四个边角
CGContextSetLineWidth(ctx, 2); CGContextSetLineWidth(ctx, 2);
CGContextSetRGBStrokeColor(ctx, 89 /255.0, 172/255.0, 220/255.0, 1);//绿色 CGContextSetRGBStrokeColor(ctx, 89 /255.0, 172/255.0, 220/255.0, 1);
//左上角 //左上角
CGPoint poinsTopLeftA[] = { CGPoint poinsTopLeftA[] = {
......
...@@ -91,9 +91,10 @@ ...@@ -91,9 +91,10 @@
[self.view addSubview:self.backBtn]; [self.view addSubview:self.backBtn];
[self.view addSubview:self.Titlelabe]; [self.view addSubview:self.Titlelabe];
[self.view addSubview:self.instructionsLine]; [self.view addSubview:self.instructionsLine];
} }
- (void)updateLayout { - (void)updateLayout {
......
This diff is collapsed.
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
@synthesize page; @synthesize page;
@synthesize rows; @synthesize rows;
@synthesize total; @synthesize total;
@synthesize totalpages;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -245,13 +246,18 @@ ...@@ -245,13 +246,18 @@
@end @end
@implementation TOGoodsCategoryEntity @implementation TOGoodsBrandEntity
@synthesize upperName;
@synthesize fid; @synthesize fid;
@synthesize createName;
@synthesize createBy;
@synthesize createDate;
@synthesize sysOrgCode;
@synthesize sysCompanyCode;
@synthesize code; @synthesize code;
@synthesize name; @synthesize name;
@synthesize upperId; @synthesize state;
@synthesize level; @synthesize logo;
@synthesize fdescription;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -262,6 +268,7 @@ ...@@ -262,6 +268,7 @@
+(JSONKeyMapper*)keyMapper +(JSONKeyMapper*)keyMapper
{ {
return [[JSONKeyMapper alloc] initWithDictionary:@{ return [[JSONKeyMapper alloc] initWithDictionary:@{
@"description": @"fdescription",
@"id": @"fid", @"id": @"fid",
}]; }];
} }
...@@ -269,12 +276,13 @@ ...@@ -269,12 +276,13 @@
@end @end
@implementation TOGoodsLabelCategoryEntity @implementation TOGoodsLabelEntity
@synthesize category;
@synthesize fid; @synthesize fid;
@synthesize sysOrgCode; @synthesize sysOrgCode;
@synthesize sysCompanyCode; @synthesize sysCompanyCode;
@synthesize code;
@synthesize name; @synthesize name;
@synthesize categoryId;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -292,29 +300,9 @@ ...@@ -292,29 +300,9 @@
@end @end
@implementation TOOrderEntity @implementation TOHottagEntity
@synthesize fid; @synthesize fid;
@synthesize createName; @synthesize name;
@synthesize createBy;
@synthesize createDate;
@synthesize updateName;
@synthesize updateBy;
@synthesize updateDate;
@synthesize sysOrgCode;
@synthesize orderNumber;
@synthesize orderTime;
@synthesize guideId;
@synthesize orderState;
@synthesize consumerId;
@synthesize goodsNum;
@synthesize orderPrice;
@synthesize receiverName;
@synthesize receiverMobile;
@synthesize receiverAddress;
@synthesize isBill;
@synthesize billType;
@synthesize billTitle;
@synthesize payType;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -332,12 +320,20 @@ ...@@ -332,12 +320,20 @@
@end @end
@implementation TOPositionEntity @implementation TOOrderdetailEntity
@synthesize fid; @synthesize fid;
@synthesize code; @synthesize goodsId;
@synthesize name; @synthesize goodsCode;
@synthesize commission; @synthesize goodsName;
@synthesize resellerCode; @synthesize goodsCover;
@synthesize goodsSpec;
@synthesize goodsBrand;
@synthesize goodsNum;
@synthesize goodsPrice;
@synthesize goodsTotalPrice;
@synthesize orderId;
@synthesize goodsUnit;
@synthesize remark;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -355,17 +351,14 @@ ...@@ -355,17 +351,14 @@
@end @end
@implementation TOShippingAddrEntity @implementation TOSceneEntity
@synthesize fid; @synthesize fid;
@synthesize createDate; @synthesize sceneCode;
@synthesize sysOrgCode;
@synthesize name; @synthesize name;
@synthesize miblephone; @synthesize pricure;
@synthesize province; @synthesize category;
@synthesize city; @synthesize style;
@synthesize country; @synthesize space;
@synthesize address;
@synthesize consumerId;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -412,6 +405,25 @@ ...@@ -412,6 +405,25 @@
} }
@end
@implementation IdEntity
@synthesize fid;
+(BOOL)propertyIsOptional:(NSString*)propertyName
{
return YES;
}
+(JSONKeyMapper*)keyMapper
{
return [[JSONKeyMapper alloc] initWithDictionary:@{
@"id": @"fid",
}];
}
@end @end
#ifndef DEF_SortDirection_M #ifndef DEF_SortDirection_M
...@@ -420,8 +432,17 @@ NSString * const SORTDIRECTION_ASC = @"asc"; ...@@ -420,8 +432,17 @@ NSString * const SORTDIRECTION_ASC = @"asc";
NSString * const SORTDIRECTION_DESC = @"desc"; NSString * const SORTDIRECTION_DESC = @"desc";
#endif /* DEF_SortDirection_M */ #endif /* DEF_SortDirection_M */
@implementation IdEntity @implementation TOShippingAddrEntity
@synthesize fid; @synthesize fid;
@synthesize createDate;
@synthesize sysOrgCode;
@synthesize name;
@synthesize miblephone;
@synthesize province;
@synthesize city;
@synthesize country;
@synthesize address;
@synthesize consumerId;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -439,14 +460,12 @@ NSString * const SORTDIRECTION_DESC = @"desc"; ...@@ -439,14 +460,12 @@ NSString * const SORTDIRECTION_DESC = @"desc";
@end @end
@implementation TOSceneEntity @implementation TOPositionEntity
@synthesize fid; @synthesize fid;
@synthesize sceneCode; @synthesize code;
@synthesize name; @synthesize name;
@synthesize pricure; @synthesize commission;
@synthesize category; @synthesize resellerCode;
@synthesize style;
@synthesize space;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -464,20 +483,29 @@ NSString * const SORTDIRECTION_DESC = @"desc"; ...@@ -464,20 +483,29 @@ NSString * const SORTDIRECTION_DESC = @"desc";
@end @end
@implementation TOOrderdetailEntity @implementation TOOrderEntity
@synthesize fid; @synthesize fid;
@synthesize goodsId; @synthesize createName;
@synthesize goodsCode; @synthesize createBy;
@synthesize goodsName; @synthesize createDate;
@synthesize goodsCover; @synthesize updateName;
@synthesize goodsSpec; @synthesize updateBy;
@synthesize goodsBrand; @synthesize updateDate;
@synthesize sysOrgCode;
@synthesize orderNumber;
@synthesize orderTime;
@synthesize guideId;
@synthesize orderState;
@synthesize consumerId;
@synthesize goodsNum; @synthesize goodsNum;
@synthesize goodsPrice; @synthesize orderPrice;
@synthesize goodsTotalPrice; @synthesize receiverName;
@synthesize orderId; @synthesize receiverMobile;
@synthesize goodsUnit; @synthesize receiverAddress;
@synthesize remark; @synthesize isBill;
@synthesize billType;
@synthesize billTitle;
@synthesize payType;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -495,8 +523,11 @@ NSString * const SORTDIRECTION_DESC = @"desc"; ...@@ -495,8 +523,11 @@ NSString * const SORTDIRECTION_DESC = @"desc";
@end @end
@implementation TOHottagEntity @implementation TOGoodsLabelCategoryEntity
@synthesize fid; @synthesize fid;
@synthesize sysOrgCode;
@synthesize sysCompanyCode;
@synthesize code;
@synthesize name; @synthesize name;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
...@@ -515,12 +546,13 @@ NSString * const SORTDIRECTION_DESC = @"desc"; ...@@ -515,12 +546,13 @@ NSString * const SORTDIRECTION_DESC = @"desc";
@end @end
@implementation TOGoodsLabelEntity @implementation TOGoodsCategoryEntity
@synthesize upperName;
@synthesize fid; @synthesize fid;
@synthesize sysOrgCode; @synthesize code;
@synthesize sysCompanyCode;
@synthesize name; @synthesize name;
@synthesize categoryId; @synthesize upperId;
@synthesize level;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -538,18 +570,42 @@ NSString * const SORTDIRECTION_DESC = @"desc"; ...@@ -538,18 +570,42 @@ NSString * const SORTDIRECTION_DESC = @"desc";
@end @end
@implementation TOGoodsBrandEntity @implementation VOResellerGoodsEntity
@synthesize fid; @synthesize fid;
@synthesize createName;
@synthesize createBy;
@synthesize createDate; @synthesize createDate;
@synthesize sysOrgCode; @synthesize onlineTime;
@synthesize sysCompanyCode; @synthesize company;
@synthesize code; @synthesize code;
@synthesize name; @synthesize name;
@synthesize number;
@synthesize categoryId;
@synthesize brandId;
@synthesize keyword;
@synthesize guidePrice;
@synthesize tagPrice;
@synthesize costPrice;
@synthesize state; @synthesize state;
@synthesize logo; @synthesize inv;
@synthesize fdescription; @synthesize detailedIntro;
@synthesize weight;
@synthesize unit;
@synthesize productProfile;
@synthesize power;
@synthesize colorTemperature;
@synthesize spec;
@synthesize function;
@synthesize material;
@synthesize lightSource;
@synthesize goodsStyle;
@synthesize series;
@synthesize area;
@synthesize size;
@synthesize space;
@synthesize installMethod;
@synthesize lightNumber;
@synthesize pictures;
@synthesize barcode;
@synthesize resellerId;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
{ {
...@@ -560,7 +616,6 @@ NSString * const SORTDIRECTION_DESC = @"desc"; ...@@ -560,7 +616,6 @@ NSString * const SORTDIRECTION_DESC = @"desc";
+(JSONKeyMapper*)keyMapper +(JSONKeyMapper*)keyMapper
{ {
return [[JSONKeyMapper alloc] initWithDictionary:@{ return [[JSONKeyMapper alloc] initWithDictionary:@{
@"description": @"fdescription",
@"id": @"fid", @"id": @"fid",
}]; }];
} }
......
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