Commit e23d89d0 authored by 勾芒's avatar 勾芒

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

parent 125a1f71
......@@ -51,6 +51,16 @@
*/
@property (nonatomic,copy) NSString *passWordString;
/**
* companyName
*/
@property (weak, nonatomic) IBOutlet UIImageView *companyName;
/**
* 背景大图
*/
@property (weak, nonatomic) IBOutlet UIImageView *backImageView;
@end
......@@ -94,6 +104,7 @@
self.passWordString = [[NSUserDefaults standardUserDefaults] objectForKey:PASSWORD];
self.userName.text = self.userNameString;
self.passWord.text = self.passWordString;
}
......@@ -184,10 +195,11 @@
} WithErrorCodeBlock:^(id errorCodeValue) {
[self ErrorMBProgressView:@"网络中"];
[self ErrorMBProgressView:@"网络中"];
} WithFailureBlock:^(id error) {
} WithFailureBlock:^(NSError *error) {
[self ErrorMBProgressView:error.localizedDescription];
[self RemoveMBProgressHUDLoding];
}];
......@@ -254,7 +266,6 @@
self.passWord.text = @"";
return;
}
self.identityView.layer.masksToBounds = YES;
self.identityView.layer.cornerRadius = 10;
[self.identityView.backLoginButton addTarget:self action:@selector(BackloginButtonClick) forControlEvents:UIControlEventTouchUpInside];
......@@ -266,7 +277,6 @@
[UIView animateWithDuration:0.2 animations:^{
self.identityView.alpha = 1;
}];
}
......@@ -284,33 +294,40 @@
[self ErrorMBProgressView:@"手机号码格式不正确"];
return;
}
[self CreateMBProgressHUDLoding];
//发送验证码
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/system/sendSms"] WithRequestType:0 WithParameter:[NSDictionary dictionaryWithObjectsAndKeys:inputPhoneNumber,@"mobilephone", nil] WithReturnValueBlock:^(id returnValue) {
//解析返回的验证码,并存储到变量
// NSLog(@"%@",returnValue);
self.verifyCode = @"1234";
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@%@",ServerAddress,@"/sendSms/send?phone=",inputPhoneNumber] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
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]];
}
}else
{
[self ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[self ErrorMBProgressView:@"网络中断"];
[self RemoveMBProgressHUDLoding];
} WithFailureBlock:^(NSError *error) {
} WithFailureBlock:^(id error) {
// NSLog(@"%@",error);
self.verifyCode = @"1234";
[self ErrorMBProgressView:error.localizedDescription];
[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 -倒计时
......@@ -401,21 +418,21 @@
[self ErrorMBProgressView:@"两次密码不相同"];
return;
}
[self CreateMBProgressHUDLoding];
//重置密码接口
ResetPasswordRequest *passwrod = [[ResetPasswordRequest alloc]init];
passwrod.fnewPassword = @"123456";
passwrod.username = @"sh1";
passwrod.smsCode = @"1234";//验证码
passwrod.fnewPassword = self.resetPasswordView.newpass.text;
passwrod.username = self.userName.text;
passwrod.smsCode = self.verifyCode;//验证码
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/employee/resetPassword"] WithRequestType:0 WithParameter:passwrod WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding];
// [self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[self ErrorMBProgressView:returnValue[@"message"]];
[self ErrorMBProgressView:@"重置密码成功"];
self.passWord.text = self.resetPasswordView.newpass.text;
[self judgeUserNameAndPassword];
}else
{
[self ErrorMBProgressView:returnValue[@"message"]];
......@@ -423,8 +440,9 @@
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) {
} WithFailureBlock:^(NSError *error) {
[self ErrorMBProgressView:error.localizedDescription];
[self RemoveMBProgressHUDLoding];
}];
......
......@@ -31,7 +31,8 @@
<rect key="frame" x="192" y="0.0" width="78" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES"/>
<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="发送">
<color key="titleColor" red="0.34901960784313724" green="0.67450980392156867" blue="0.86274509803921573" alpha="1" colorSpace="calibratedRGB"/>
</state>
......@@ -58,7 +59,7 @@
<rect key="frame" x="40" y="0.0" width="230" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<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"/>
<textInputTraits key="textInputTraits"/>
</textField>
......@@ -133,12 +134,12 @@
<rect key="frame" x="25" y="67" width="270" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<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"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
<textInputTraits key="textInputTraits" secureTextEntry="YES"/>
</textField>
<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"/>
......@@ -160,12 +161,12 @@
<rect key="frame" x="25" y="135" width="270" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<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"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
<textInputTraits key="textInputTraits" secureTextEntry="YES"/>
</textField>
<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"/>
......
......@@ -191,7 +191,7 @@
}else if (indexPath.section == 1)
{
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;
}
......@@ -214,7 +214,7 @@
return 170;
}
return ScreenWidth;
return ScreenWidth*3/4;
}
......@@ -382,7 +382,7 @@
SaveShoppingCartRequest *shopCar = [[SaveShoppingCartRequest alloc]init];
shopCar.consumerId = [[Customermanager manager] customerID];
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) {
if ([returnValue[@"code"] isEqualToNumber:@0]) {
......
......@@ -67,6 +67,11 @@
*/
@property (nonatomic,assign) int totalPages;
/**
* 筛选模型
*/
@property (nonatomic,strong) GoodsCondition *condtionModel;
......@@ -101,6 +106,16 @@
}
/**
* 初始化复选模型
*/
- (GoodsCondition *)condtionModel
{
if (!_condtionModel) {
_condtionModel = [[GoodsCondition alloc]init];
}
return _condtionModel;
}
- (void)viewDidLoad {
[super viewDidLoad];
......@@ -232,22 +247,19 @@
}else
{
//默认数据
GoodsCondition *conditon = [[GoodsCondition alloc]init];
//分页数据
DataPage *Newpage = [[DataPage alloc]init];
Newpage.page = 1;
Newpage.rows = KROWS;
conditon.page = Newpage;
self.condtionModel.page = Newpage;
self.indexPage = 1;
//搜索
if (_selectedCode) {
conditon.categoryEquals = _selectedCode;
conditon.nameLike = _selectedCode;
self.condtionModel.categoryEquals = _selectedCode;
}
[self.productCollectionView.mj_footer resetNoMoreData];
[self getScreeningdatasisRemoveArray:YES];
[self getGoodsListDatasisRemove:YES Withobject:conditon];
[self getGoodsListDatasisRemove:YES Withobject:self.condtionModel];
}
}];
headerRefresh.stateLabel.hidden = YES;
......@@ -265,23 +277,21 @@
}else
{
//默认数据
GoodsCondition *conditon = [[GoodsCondition alloc]init];
//分页数据
DataPage *Newpage = [[DataPage alloc]init];
if (self.indexPage ++ > self.totalPages) {
[self.productCollectionView.mj_footer endRefreshingWithNoMoreData];
}else
{
//分页数据
DataPage *Newpage = [[DataPage alloc]init];
Newpage.page = self.indexPage ++;
Newpage.rows = KROWS;
conditon.page = Newpage;
self.condtionModel.page = Newpage;
//搜索
if (_selectedCode) {
conditon.categoryEquals = _selectedCode;
conditon.nameLike = _selectedCode;
self.condtionModel.categoryEquals = _selectedCode;
}
[self getGoodsListDatasisRemove:NO Withobject:conditon];
[self getGoodsListDatasisRemove:NO Withobject:self.condtionModel];
}
}
}];
......@@ -294,6 +304,7 @@
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@%@",ServerAddress,@"/goods/getGoodsByCode/",_barcode] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[self endRefreshingForTableView:self.productCollectionView];
[self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
......@@ -309,12 +320,14 @@
} WithErrorCodeBlock:^(id errorCodeValue) {
[self endRefreshingForTableView:self.productCollectionView];
[self ErrorMBProgressView:@"网络连接中断"];
[self RemoveMBProgressHUDLoding];
} WithFailureBlock:^(id error) {
[self ErrorMBProgressView:@"查询失败"];
[self endRefreshingForTableView:self.productCollectionView];
[self RemoveMBProgressHUDLoding];
}];
}
......@@ -379,7 +392,6 @@
}];
[weakSelf StartAddShoppingCarAnimationWithimage:weakCell.productImageView.image withStartpoint:centerPoint];
}];
return cell;
}
......@@ -459,7 +471,6 @@
- (void)ScreeningButtonClick
{
self.screenView = [[[NSBundle mainBundle] loadNibNamed:@"ScreeningView" owner:self options:nil]firstObject];
self.screenView.frame = CGRectMake(0, 0, ScreenWidth, ScreenHeight);
self.screenView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
......@@ -556,22 +567,8 @@
- (void)selectedItem:(NSString *)typecode
{
[self DismissScreenView];
GoodsCondition *condition = [[GoodsCondition alloc]init];
DataPage *page = [[DataPage alloc]init];
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:@"暂无数据"];
}
}];
self.selectedCode = typecode;
[self.productCollectionView.mj_header beginRefreshing];
}
......@@ -597,7 +594,8 @@
GoodsCondition *condition = [[GoodsCondition alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = 0;
page.rows = 10;
page.page = 1;
condition.page = page;
if (styleCode.length != 0) {
condition.styleEquals = styleCode;
......@@ -618,6 +616,16 @@
condition.startprice = [NSNumber numberWithInteger:[[spacrArray objectAtIndex_opple:0] 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;
[self getGoodsListdatas:condition returnResponse:^(GoodsResponse *response) {
......@@ -652,7 +660,6 @@
}completion:^(BOOL finished) {
[self.screenView removeFromSuperview];
}];
}
......@@ -683,7 +690,7 @@
SaveShoppingCartRequest *shopCar = [[SaveShoppingCartRequest alloc]init];
shopCar.consumerId = [[Customermanager manager] customerID];
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) {
if ([returnValue[@"code"] isEqualToNumber:@0]) {
......@@ -697,7 +704,6 @@
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) {
[self ErrorMBProgressView:@"加入购物车失败"];
}];
......
......@@ -118,7 +118,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
// [tableView deselectRowAtIndexPath:indexPath animated:YES];
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
if ([cell.textLabel.text isEqualToString:@"客户管理"] ) {
......
......@@ -231,6 +231,7 @@
#pragma mark -切换显示风格
- (IBAction)SwitchdisplayStyleClick:(UIButton *)sender {
[self dismissViewControllerAnimated:NO completion:nil];
[self ShowPopoverViewController:CGSizeMake(55, 180) Withdatas:self.imageArray ShowButton:sender SelectedIndex:100];
}
......@@ -238,8 +239,13 @@
#pragma mark -筛选风格
- (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 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 @@
#pragma mark -空间风格
- (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 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 @@
[self dismissViewControllerAnimated:YES completion:nil];
SceneCondition *condition = [[SceneCondition alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = 0;
page.page = 1;
condition.page = page;
//空间code
......
......@@ -8,6 +8,16 @@
#import <UIKit/UIKit.h>
/**
* 选中cell回调
*/
@protocol ButtonClickActiondelegate <NSObject>
- (void)SelectedButtonClickAction:(NSIndexPath *)indexpath;
@end
@interface ScreeningFirstCollectionViewCell : UICollectionViewCell
......@@ -15,7 +25,15 @@
/**
* 显示的labe
*/
@property (nonatomic,strong) UILabel *titleLabe;
@property (nonatomic,strong) UIButton *titleLabe;
/**
* cell下标信息
*/
@property (nonatomic,strong) NSIndexPath *indexpath;
@property (nonatomic,strong)id<ButtonClickActiondelegate>delegate;
@end
......@@ -25,17 +25,28 @@
- (void)uiConfigAction
{
self.contentView.layer.masksToBounds = YES;
self.contentView.layer.cornerRadius = kCornerRadius;
self.contentView.layer.borderWidth = 1;
self.contentView.layer.borderColor = kMainBlueColor.CGColor;
self.titleLabe = [[UILabel alloc]initWithFrame:self.contentView.bounds];
self.titleLabe.textColor = kMainBlueColor;
self.titleLabe.font = [UIFont systemFontOfSize:12];
self.titleLabe.textAlignment = NSTextAlignmentCenter;
self.titleLabe = [UIButton buttonWithType:UIButtonTypeCustom];
self.titleLabe.frame = self.contentView.frame;
[self.titleLabe setTitleColor:kMainBlueColor forState:UIControlStateNormal];
[self.titleLabe setBackgroundImage:TCImage(@"kamincolor") forState:UIControlStateHighlighted];
[self.titleLabe setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted];
self.titleLabe.titleLabel.font = [UIFont systemFontOfSize:12];
[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
......@@ -8,6 +8,10 @@
#import <UIKit/UIKit.h>
@interface ScreeningSecondCollectionReusableView : UICollectionReusableView
......@@ -24,4 +28,6 @@
@property (nonatomic,strong) UIButton *subTitleButton;
@end
......@@ -10,6 +10,7 @@
#define WIDTH self.frame.size.width
#define HEIGHT self.frame.size.height
@implementation ScreeningSecondCollectionReusableView
......@@ -27,14 +28,19 @@
#pragma mark -UI
- (void)uiConfigAction
{
self.alltitleButton = [UIButton buttonWithType:UIButtonTypeSystem];
self.alltitleButton = [UIButton buttonWithType:UIButtonTypeCustom];
self.alltitleButton.layer.masksToBounds = YES;
self.alltitleButton.layer.cornerRadius = kCornerRadius;
[self.alltitleButton setTitle:@"全部" forState:UIControlStateNormal];
[self addSubview:self.alltitleButton];
self.alltitleButton.titleLabel.font = [UIFont systemFontOfSize:12];
[self.alltitleButton setBackgroundColor:kMainBlueColor];
[self.alltitleButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[self.alltitleButton setTitleColor:kMainBlueColor 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) {
make.size.mas_equalTo(CGSizeMake((WIDTH-127)/3, 35));
......@@ -42,21 +48,21 @@
make.top.equalTo(self.mas_top).offset(20);
}];
//副标题按钮
self.subTitleButton = [UIButton buttonWithType:UIButtonTypeSystem];
self.subTitleButton = [UIButton buttonWithType:UIButtonTypeCustom];
[self.subTitleButton setTitle:@"副标题" forState:UIControlStateNormal];
[self addSubview:self.subTitleButton];
self.subTitleButton.titleLabel.font = [UIFont systemFontOfSize:12];
[self.subTitleButton setTitleColor:kMainBlueColor forState:UIControlStateNormal];
[self.subTitleButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake((WIDTH-127)/3, 35));
make.right.equalTo(self.mas_right).offset(-30);
make.top.equalTo(self.mas_top).offset(75);
}];
}
@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 @@
SaveShoppingCartRequest *shopCar = [[SaveShoppingCartRequest alloc]init];
shopCar.consumerId = [[Customermanager manager] customerID];
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) {
if ([returnValue[@"code"] isEqualToNumber:@0]) {
......
......@@ -261,9 +261,12 @@
{
QRViewController *qrVC = [[QRViewController alloc] initWithScanCompleteHandler:^(NSString *url) {
[self dismissViewControllerAnimated:YES completion:nil];
NSLog(@"%@",url);
[self dismissViewControllerAnimated:YES completion:^{
ProductLibraryViewController *product = [SHARED_APPDELEGATE.allControllerArray objectAtIndex_opple:4];
product.barcode = url;
self.selectedIndex = 4;
}];
}];
[self presentViewController:qrVC animated:YES completion:nil];
}
......
......@@ -7,7 +7,8 @@
//
#import <UIKit/UIKit.h>
#import "ScreeningFirstCollectionViewCell.h"
#import "ScreeningCollectionReusableView.h"
/**
* 选中item
......@@ -21,7 +22,7 @@
@interface screeningFirstView : UIView<UICollectionViewDelegate,UICollectionViewDataSource>
@interface screeningFirstView : UIView<UICollectionViewDelegate,UICollectionViewDataSource,ButtonClickActiondelegate,ButtonClickActiondelegate>
/**
......@@ -65,4 +66,5 @@
@end
......@@ -7,8 +7,7 @@
//
#import "screeningFirstView.h"
#import "ScreeningFirstCollectionViewCell.h"
#import "ScreeningCollectionReusableView.h"
#define WIDTH self.frame.size.width
@implementation screeningFirstView
......@@ -36,9 +35,6 @@
}
#pragma mark -UI
- (void)uiConfigAction
{
......@@ -61,21 +57,20 @@
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
ScreeningFirstCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
cell.indexpath = indexPath;
cell.delegate = self;
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
{
cell.titleLabe.text = [[self.datasArray objectAtIndex_opple:indexPath.row] typename];
[cell.titleLabe setTitle:[[self.datasArray objectAtIndex_opple:indexPath.row] typename] forState:UIControlStateNormal];
}
return cell;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
if (self.selectedIndex == 1) {
......@@ -86,22 +81,25 @@
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.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
{
[self.delegate selectedItem:[[self.datasArray objectAtIndex_opple:indexPath.row] typecode]];
[self.delegate selectedItem:[[self.datasArray objectAtIndex_opple:indexpath.row] typecode]];
}
}
}
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView
{
if (self.selectedIndex == 1) {
......
......@@ -7,7 +7,8 @@
//
#import <UIKit/UIKit.h>
#import "ScreeningFirstCollectionViewCell.h"
#import "ScreeningSecondCollectionReusableView.h"
/**
* tableview模块的选中
......@@ -28,7 +29,11 @@
@end
@interface screeningSecondView : UIView<UITableViewDelegate,UITableViewDataSource,UICollectionViewDelegate,UICollectionViewDataSource>
@interface screeningSecondView : UIView<UITableViewDelegate,UITableViewDataSource,UICollectionViewDelegate,UICollectionViewDataSource,ButtonClickActiondelegate>
......
......@@ -7,9 +7,7 @@
//
#import "screeningSecondView.h"
#import "ScreeningFirstCollectionViewCell.h"
#import "ScreeningSecondCollectionReusableView.h"
#import "SelectedTableViewCell.h"
#define WIDTH self.screeningCollectionView.frame.size.width
......@@ -43,18 +41,33 @@
- (void)setDatasArray:(NSArray *)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];
}
#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 - 布局
- (void)uiConfigAction
{
self.screeningTableview.delegate = self;
self.screeningTableview.dataSource = self;
self.screeningTableview.tableFooterView = [UIView new];
self.screeningTableview.separatorStyle = UITableViewCellSeparatorStyleNone;
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.minimumLineSpacing = 30;
self.screeningLayout.minimumInteritemSpacing = 10;
......@@ -71,12 +84,9 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"tableviewcell" forIndexPath:indexPath];
cell.textLabel.text = [self.defaultDatasArray objectAtIndex_opple:indexPath.row][@"typename"];
cell.textLabel.font = [UIFont systemFontOfSize:10];
cell.selectedBackgroundView.backgroundColor = [UIColor whiteColor];
cell.backgroundColor = [UIColor grayColor];
cell.textLabel.textAlignment = NSTextAlignmentCenter;
SelectedTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"tableviewcell" forIndexPath:indexPath];
cell.titleLabe.text = [self.defaultDatasArray objectAtIndex_opple:indexPath.row][@"typename"];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
......@@ -92,7 +102,10 @@
- (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:)]) {
[self.delegate tableSelectedindex:indexPath.row];
......@@ -102,13 +115,15 @@
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
ScreeningFirstCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
cell.indexpath = indexPath;
cell.delegate = self;
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
{
cell.titleLabe.text = [[self.datasArray objectAtIndex_opple:indexPath.row] typename];
[cell.titleLabe setTitle:[[self.datasArray objectAtIndex_opple:indexPath.row] typename] forState:UIControlStateNormal];
}
return cell;
}
......@@ -123,21 +138,43 @@
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
{
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) {
NSString *subTitle = [[self.datasArray objectAtIndex_opple:indexPath.section] name];
[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;
}
......@@ -145,45 +182,52 @@
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section{
if (self.selectedIndex == 1 && section == 0) {
return CGSizeMake(self.screeningCollectionView.frame.size.width, 130);
}
return CGSizeMake(self.screeningCollectionView.frame.size.width, 75);
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
#pragma mark -选中回调
- (void)SelectedButtonClickAction:(NSIndexPath *)indexpath
{
//选中后的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;
//选中的key
NSString *selectedTypecode = nil;
if (self.selectedIndex == 1) {
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];
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];
}
else
{
selectedTitle = [[self.datasArray objectAtIndex_opple:indexPath.row] typename];
selectedTypecode = [[self.datasArray objectAtIndex_opple:indexPath.row] typecode];
selectedTitle = [[self.datasArray objectAtIndex_opple:indexpath.row] typename];
selectedTypecode = [[self.datasArray objectAtIndex_opple:indexpath.row] typecode];
}
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:selectedTitle,@"typename",selectedTypecode,@"typecode", nil];
[self.defaultDatasArray replaceObjectAtIndex:self.selectedIndex withObject:dict];
cell.textLabel.text = selectedTitle;
cell.titleLabe.text = selectedTitle;
[self JudgeDelegateIsPerformWithPassParamater];
}
#pragma mark -区头的全部按钮点击
- (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];
[self.defaultDatasArray replaceObjectAtIndex:self.selectedIndex withObject:dict];
[self JudgeDelegateIsPerformWithPassParamater];
......
......@@ -111,6 +111,7 @@
29BFBD981CE46FDA00C238FB /* MyclientEntityModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 29BFBD971CE46FDA00C238FB /* MyclientEntityModel.m */; };
29C584E91CDA249300C6F677 /* ProductCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29C584E81CDA249200C6F677 /* ProductCollectionViewCell.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 */; };
29D260F81CEEAF2D00A9787D /* FullScreenViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D260F71CEEAF2D00A9787D /* FullScreenViewCell.m */; };
29D260FB1CEECDFF00A9787D /* goodsDetailsTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D260FA1CEECDFF00A9787D /* goodsDetailsTableViewCell.m */; };
......@@ -327,6 +328,8 @@
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>"; };
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>"; };
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>"; };
......@@ -879,6 +882,8 @@
29834EB51CDF1EB6001A484F /* screeningSecondView.xib */,
29F726021CE1E96E0072FE0E /* ScreeningSecondCollectionReusableView.h */,
29F726031CE1E96E0072FE0E /* ScreeningSecondCollectionReusableView.m */,
29CCA43A1CF7ED6100BC19DD /* SelectedTableViewCell.h */,
29CCA43B1CF7ED6100BC19DD /* SelectedTableViewCell.m */,
);
name = screeningSecondView;
sourceTree = "<group>";
......@@ -1483,6 +1488,7 @@
041636C21CF395B7008CE961 /* NSObject+UIImagePickerController.m in Sources */,
044CD6F11CEB81350004A715 /* ProductCollectionPictureCell.m in Sources */,
29BFBD8F1CE44BA900C238FB /* goodsDetailsSectionview.m in Sources */,
29CCA43C1CF7ED6100BC19DD /* SelectedTableViewCell.m in Sources */,
294CF0EC1CEDCF480055F1D8 /* PromptinformationView.m in Sources */,
290887131CE5DF16000B7097 /* ShopcarModel.m in Sources */,
04FCB1A41CF60A8F0056093B /* DeviceDirectionManager.m in Sources */,
......@@ -1664,6 +1670,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer: 云霄 曹 (WM8ZU7YY98)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: 云霄 曹 (WM8ZU7YY98)";
COMPRESS_PNG_FILES = NO;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SRCROOT)/Tools/PrefixHeader.pch";
......@@ -1719,6 +1726,7 @@
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
COMPRESS_PNG_FILES = NO;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SRCROOT)/Tools/PrefixHeader.pch";
......
......@@ -95,6 +95,8 @@
</view>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="iPadPro"/>
<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="loginButton" destination="gRP-i4-Dn9" id="td3-dH-PmD"/>
<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 @@
"images" : [
{
"idiom" : "universal",
"filename" : "bg-img 副本.jpg",
"filename" : "bg-img 副本.png",
"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 @@
hud.labelText = errorString;
hud.margin = 10.f;
hud.color = [[UIColor blackColor] colorWithAlphaComponent:0.5];
hud.minSize = CGSizeMake(200, 50);
hud.minSize = CGSizeMake(250, 70);
hud.animationType = MBProgressHUDAnimationZoom;
hud.mode = MBProgressHUDModeText;
hud.removeFromSuperViewOnHide = YES;
......
......@@ -12,7 +12,7 @@
//定义返回数据的block类型
typedef void (^ReturnValueBlock) (id returnValue);
typedef void (^ErrorCodeBlock) (id errorCodeValue);
typedef void (^FailureBlock)(id error);
typedef void (^FailureBlock)(NSError *error);
//定义请求类型
......
......@@ -7,10 +7,10 @@
//
#import "PDFViewController.h"
#import <WebKit/WebKit.h>
@interface PDFViewController ()<WKNavigationDelegate>
@interface PDFViewController ()<UIWebViewDelegate>
@property (nonatomic,strong) UIWebView *webView;
@property (nonatomic,strong) WKWebView *webView;
@end
......@@ -27,11 +27,9 @@
#pragma mark -UI
- (void)uiConfigAction
{
self.webView = [[UIWebView alloc] initWithFrame:self.view.bounds];
self.webView = [[WKWebView alloc] initWithFrame:self.view.bounds];
[self.view addSubview:self.webView];
self.webView.scalesPageToFit = YES;
self.webView.delegate = self;
// NSString *path = [[NSBundle mainBundle] pathForResource:@"A0516052613060001" ofType:@"pdf"];
self.webView.navigationDelegate = self;
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:_pdfURLString]];
[self.webView loadRequest:request];
[self.view addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(PDFClickAction)]];
......@@ -44,24 +42,22 @@
[self dismissViewControllerAnimated:YES completion:nil];
}
#pragma mark -加载错误
- (void)webView:(UIWebView *)webView didFailLoadWithError:(nullable NSError *)error
{
[self ErrorMBProgressView:@"加载错误"];
[self dismissViewControllerAnimated:YES completion:nil];
}
- (void)webViewDidStartLoad:(UIWebView *)webView
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(null_unspecified WKNavigation *)navigation
{
[self CreateMBProgressHUDLoding];
}
- (void)webViewDidFinishLoad:(UIWebView *)webView
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation
{
[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;
//画四个边角
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[] = {
......
......@@ -91,9 +91,10 @@
[self.view addSubview:self.backBtn];
[self.view addSubview:self.Titlelabe];
[self.view addSubview:self.instructionsLine];
}
- (void)updateLayout {
......
This diff is collapsed.
......@@ -5,6 +5,7 @@
@synthesize page;
@synthesize rows;
@synthesize total;
@synthesize totalpages;
+(BOOL)propertyIsOptional:(NSString*)propertyName
{
......@@ -245,13 +246,18 @@
@end
@implementation TOGoodsCategoryEntity
@synthesize upperName;
@implementation TOGoodsBrandEntity
@synthesize fid;
@synthesize createName;
@synthesize createBy;
@synthesize createDate;
@synthesize sysOrgCode;
@synthesize sysCompanyCode;
@synthesize code;
@synthesize name;
@synthesize upperId;
@synthesize level;
@synthesize state;
@synthesize logo;
@synthesize fdescription;
+(BOOL)propertyIsOptional:(NSString*)propertyName
{
......@@ -262,6 +268,7 @@
+(JSONKeyMapper*)keyMapper
{
return [[JSONKeyMapper alloc] initWithDictionary:@{
@"description": @"fdescription",
@"id": @"fid",
}];
}
......@@ -269,12 +276,13 @@
@end
@implementation TOGoodsLabelCategoryEntity
@implementation TOGoodsLabelEntity
@synthesize category;
@synthesize fid;
@synthesize sysOrgCode;
@synthesize sysCompanyCode;
@synthesize code;
@synthesize name;
@synthesize categoryId;
+(BOOL)propertyIsOptional:(NSString*)propertyName
{
......@@ -292,29 +300,9 @@
@end
@implementation TOOrderEntity
@implementation TOHottagEntity
@synthesize fid;
@synthesize createName;
@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;
@synthesize name;
+(BOOL)propertyIsOptional:(NSString*)propertyName
{
......@@ -332,12 +320,20 @@
@end
@implementation TOPositionEntity
@implementation TOOrderdetailEntity
@synthesize fid;
@synthesize code;
@synthesize name;
@synthesize commission;
@synthesize resellerCode;
@synthesize goodsId;
@synthesize goodsCode;
@synthesize goodsName;
@synthesize goodsCover;
@synthesize goodsSpec;
@synthesize goodsBrand;
@synthesize goodsNum;
@synthesize goodsPrice;
@synthesize goodsTotalPrice;
@synthesize orderId;
@synthesize goodsUnit;
@synthesize remark;
+(BOOL)propertyIsOptional:(NSString*)propertyName
{
......@@ -355,17 +351,14 @@
@end
@implementation TOShippingAddrEntity
@implementation TOSceneEntity
@synthesize fid;
@synthesize createDate;
@synthesize sysOrgCode;
@synthesize sceneCode;
@synthesize name;
@synthesize miblephone;
@synthesize province;
@synthesize city;
@synthesize country;
@synthesize address;
@synthesize consumerId;
@synthesize pricure;
@synthesize category;
@synthesize style;
@synthesize space;
+(BOOL)propertyIsOptional:(NSString*)propertyName
{
......@@ -412,6 +405,25 @@
}
@end
@implementation IdEntity
@synthesize fid;
+(BOOL)propertyIsOptional:(NSString*)propertyName
{
return YES;
}
+(JSONKeyMapper*)keyMapper
{
return [[JSONKeyMapper alloc] initWithDictionary:@{
@"id": @"fid",
}];
}
@end
#ifndef DEF_SortDirection_M
......@@ -420,8 +432,17 @@ NSString * const SORTDIRECTION_ASC = @"asc";
NSString * const SORTDIRECTION_DESC = @"desc";
#endif /* DEF_SortDirection_M */
@implementation IdEntity
@implementation TOShippingAddrEntity
@synthesize fid;
@synthesize createDate;
@synthesize sysOrgCode;
@synthesize name;
@synthesize miblephone;
@synthesize province;
@synthesize city;
@synthesize country;
@synthesize address;
@synthesize consumerId;
+(BOOL)propertyIsOptional:(NSString*)propertyName
{
......@@ -439,14 +460,12 @@ NSString * const SORTDIRECTION_DESC = @"desc";
@end
@implementation TOSceneEntity
@implementation TOPositionEntity
@synthesize fid;
@synthesize sceneCode;
@synthesize code;
@synthesize name;
@synthesize pricure;
@synthesize category;
@synthesize style;
@synthesize space;
@synthesize commission;
@synthesize resellerCode;
+(BOOL)propertyIsOptional:(NSString*)propertyName
{
......@@ -464,20 +483,29 @@ NSString * const SORTDIRECTION_DESC = @"desc";
@end
@implementation TOOrderdetailEntity
@implementation TOOrderEntity
@synthesize fid;
@synthesize goodsId;
@synthesize goodsCode;
@synthesize goodsName;
@synthesize goodsCover;
@synthesize goodsSpec;
@synthesize goodsBrand;
@synthesize createName;
@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 goodsPrice;
@synthesize goodsTotalPrice;
@synthesize orderId;
@synthesize goodsUnit;
@synthesize remark;
@synthesize orderPrice;
@synthesize receiverName;
@synthesize receiverMobile;
@synthesize receiverAddress;
@synthesize isBill;
@synthesize billType;
@synthesize billTitle;
@synthesize payType;
+(BOOL)propertyIsOptional:(NSString*)propertyName
{
......@@ -495,8 +523,11 @@ NSString * const SORTDIRECTION_DESC = @"desc";
@end
@implementation TOHottagEntity
@implementation TOGoodsLabelCategoryEntity
@synthesize fid;
@synthesize sysOrgCode;
@synthesize sysCompanyCode;
@synthesize code;
@synthesize name;
+(BOOL)propertyIsOptional:(NSString*)propertyName
......@@ -515,12 +546,13 @@ NSString * const SORTDIRECTION_DESC = @"desc";
@end
@implementation TOGoodsLabelEntity
@implementation TOGoodsCategoryEntity
@synthesize upperName;
@synthesize fid;
@synthesize sysOrgCode;
@synthesize sysCompanyCode;
@synthesize code;
@synthesize name;
@synthesize categoryId;
@synthesize upperId;
@synthesize level;
+(BOOL)propertyIsOptional:(NSString*)propertyName
{
......@@ -538,18 +570,42 @@ NSString * const SORTDIRECTION_DESC = @"desc";
@end
@implementation TOGoodsBrandEntity
@implementation VOResellerGoodsEntity
@synthesize fid;
@synthesize createName;
@synthesize createBy;
@synthesize createDate;
@synthesize sysOrgCode;
@synthesize sysCompanyCode;
@synthesize onlineTime;
@synthesize company;
@synthesize code;
@synthesize name;
@synthesize number;
@synthesize categoryId;
@synthesize brandId;
@synthesize keyword;
@synthesize guidePrice;
@synthesize tagPrice;
@synthesize costPrice;
@synthesize state;
@synthesize logo;
@synthesize fdescription;
@synthesize inv;
@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
{
......@@ -560,7 +616,6 @@ NSString * const SORTDIRECTION_DESC = @"desc";
+(JSONKeyMapper*)keyMapper
{
return [[JSONKeyMapper alloc] initWithDictionary:@{
@"description": @"fdescription",
@"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