Skip to content

Commit

Permalink
修改问题商品列表mode
Browse files Browse the repository at this point in the history
  • Loading branch information
woaomo committed Sep 10, 2015
1 parent f4c4dd1 commit 5078ff0
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 21 deletions.
6 changes: 6 additions & 0 deletions YHB_Prj/YHB_Prj.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
ABEF1DA71B929D5400C1C2EA /* SupplierDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ABEF1DA61B929D5400C1C2EA /* SupplierDetailViewController.m */; };
ABEF1DAB1B92A18E00C1C2EA /* ClerkDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ABEF1DAA1B92A18E00C1C2EA /* ClerkDetailViewController.m */; };
ABEF1DAF1B92AD2700C1C2EA /* TenantViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ABEF1DAE1B92AD2700C1C2EA /* TenantViewController.m */; };
ABFAB0E51BA1ABCD009D8654 /* PGProductList.m in Sources */ = {isa = PBXBuildFile; fileRef = ABFAB0E41BA1ABCD009D8654 /* PGProductList.m */; };
FF012FA91B8EB92C00AE563C /* VipInfoMode.m in Sources */ = {isa = PBXBuildFile; fileRef = FF012F941B8EB92C00AE563C /* VipInfoMode.m */; };
FF012FAA1B8EB92C00AE563C /* HYXFJLListViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = FF012F961B8EB92C00AE563C /* HYXFJLListViewController.xib */; };
FF012FAB1B8EB92C00AE563C /* HYXFJLListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FF012F971B8EB92C00AE563C /* HYXFJLListViewController.m */; };
Expand Down Expand Up @@ -414,6 +415,8 @@
ABEF1DAA1B92A18E00C1C2EA /* ClerkDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ClerkDetailViewController.m; sourceTree = "<group>"; };
ABEF1DAD1B92AD2700C1C2EA /* TenantViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TenantViewController.h; sourceTree = "<group>"; };
ABEF1DAE1B92AD2700C1C2EA /* TenantViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TenantViewController.m; sourceTree = "<group>"; };
ABFAB0E31BA1ABCD009D8654 /* PGProductList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PGProductList.h; sourceTree = "<group>"; };
ABFAB0E41BA1ABCD009D8654 /* PGProductList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PGProductList.m; sourceTree = "<group>"; };
FF012F941B8EB92C00AE563C /* VipInfoMode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VipInfoMode.m; sourceTree = "<group>"; };
FF012F951B8EB92C00AE563C /* VipInfoMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VipInfoMode.h; sourceTree = "<group>"; };
FF012F961B8EB92C00AE563C /* HYXFJLListViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = HYXFJLListViewController.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -955,6 +958,8 @@
AB311F991B9BFCEE0070784E /* PGResult.m */,
AB311F9A1B9BFCEE0070784E /* PGRows.h */,
AB311F9B1B9BFCEE0070784E /* PGRows.m */,
ABFAB0E31BA1ABCD009D8654 /* PGProductList.h */,
ABFAB0E41BA1ABCD009D8654 /* PGProductList.m */,
);
path = PGModel;
sourceTree = "<group>";
Expand Down Expand Up @@ -2070,6 +2075,7 @@
FF2A6C991A0F3D1C001607AC /* ThirdViewController.m in Sources */,
FF5CC70A1B93FA0B00F55713 /* JCCXViewController.m in Sources */,
AB311F8C1B9BDBFE0070784E /* ProblemGoodsViewController.m in Sources */,
ABFAB0E51BA1ABCD009D8654 /* PGProductList.m in Sources */,
ABAAFB6F1B996B250012D1C6 /* DJYDCXRows.m in Sources */,
AB42ACD01B8B4140001FB93A /* FourthTableViewCell.m in Sources */,
FFF391971B846F58007DC652 /* AFNetworkReachabilityManager.m in Sources */,
Expand Down
26 changes: 16 additions & 10 deletions YHB_Prj/YHB_Prj/FourthViewController/FourthViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ @interface FourthViewController ()<UITableViewDataSource, UITableViewDelegate, U
UITapGestureRecognizer *_tapGR;
UITableView *_storeTV;
NSArray *_storeArr;

//设置页面的view宽度
CGFloat viewWidth;
}
@end

Expand All @@ -76,31 +79,34 @@ - (void)viewDidLoad {
[super viewDidLoad];
[self settitleLabel:@"我的"];

//设置页面的view宽度
viewWidth = kMainScreenWidth;

LoginMode *mode = [[LoginManager shareLoginManager] getLoginMode];

CGFloat topImgViewH = kMainScreenWidth/320*206;
_topImgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kMainScreenWidth, topImgViewH)];
CGFloat topImgViewH = viewWidth/320*206;
_topImgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, viewWidth, topImgViewH)];
_topImgView.image = [UIImage imageNamed:@"mine_bg_1"];

CGFloat mengViewH = kMainScreenWidth/320*176;
_topMengView = [[UIImageView alloc] initWithFrame:CGRectMake(0, _topImgView.height-mengViewH, kMainScreenWidth, mengViewH)];
CGFloat mengViewH = viewWidth/320*176;
_topMengView = [[UIImageView alloc] initWithFrame:CGRectMake(0, _topImgView.height-mengViewH, viewWidth, mengViewH)];
_topMengView.image = [UIImage imageNamed:@"mine_bg_1_meng"];
[_topImgView addSubview:_topMengView];

CGFloat originX = 15;
CGFloat interval = 10;
NSString *comStr = [NSString stringWithFormat:@"公司名称:%@", mode.strCompanyName];
kCreateLabel(_userComLabel, CGRectMake(originX, topImgViewH-30, kMainScreenWidth-2*originX, 17), 14, [UIColor whiteColor], comStr);
kCreateLabel(_userComLabel, CGRectMake(originX, topImgViewH-30, viewWidth-2*originX, 17), 14, [UIColor whiteColor], comStr);
[_topImgView addSubview:_userComLabel];

NSString *userStr = [NSString stringWithFormat:@"掌柜:%@", mode.strNickName];
kCreateLabel(_userNameLabel, CGRectMake(originX, _userComLabel.top-17-interval, kMainScreenWidth/2.0-originX-10, 17), 14, [UIColor whiteColor], userStr);
kCreateLabel(_userNameLabel, CGRectMake(originX, _userComLabel.top-17-interval, viewWidth/2.0-originX-10, 17), 14, [UIColor whiteColor], userStr);
[_topImgView addSubview:_userNameLabel];

//字体
CGFloat stringWidth = [@"信用:" sizeWithAttributes:[NSDictionary dictionaryWithObjectsAndKeys:kFont14,NSFontAttributeName, nil]].width;

kCreateLabel(_userProLabel, CGRectMake(kMainScreenWidth/2.0, _userNameLabel.top, stringWidth, 17), 14, [UIColor whiteColor], @"信用:");
kCreateLabel(_userProLabel, CGRectMake(viewWidth/2.0, _userNameLabel.top, stringWidth, 17), 14, [UIColor whiteColor], @"信用:");
[_topImgView addSubview:_userProLabel];

_proBgView = [[UIView alloc] initWithFrame:CGRectMake(_userProLabel.right, _userProLabel.top+3.5, 100, 11)];
Expand Down Expand Up @@ -143,7 +149,7 @@ - (void)viewDidLoad {
_topImgView.userInteractionEnabled = YES;
[_topImgView addSubview:_userImgBtn];

_mineTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, kMainScreenWidth, kMainScreenHeight-64-49)];
_mineTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, viewWidth, kMainScreenHeight-64-49)];
_mineTableView.delegate = self;
_mineTableView.dataSource = self;
_mineTableView.tableHeaderView = _topImgView;
Expand Down Expand Up @@ -171,7 +177,7 @@ - (void)createMaskingView

CGFloat cellHeight = 30;
CGFloat storeTVHeight = cellHeight*_storeArr.count>120?120:cellHeight*_storeArr.count;
_storeTV = [[UITableView alloc] initWithFrame:CGRectMake(kMainScreenWidth/2.0-storeTVWidth/2.0, _maskingView.height/2.0-storeTVHeight/2.0, storeTVWidth, storeTVHeight)];
_storeTV = [[UITableView alloc] initWithFrame:CGRectMake(viewWidth/2.0-storeTVWidth/2.0, _maskingView.height/2.0-storeTVHeight/2.0, storeTVWidth, storeTVHeight)];
_storeTV.delegate =self;
_storeTV.dataSource = self;
_storeTV.separatorStyle = UITableViewCellSeparatorStyleNone;
Expand Down Expand Up @@ -231,7 +237,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
else
{
UITableViewCell *cell = [[UITableViewCell alloc] init];
UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(0, 5, kMainScreenWidth-50, 0.5)];
UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(0, 5, viewWidth-50, 0.5)];
lineView.backgroundColor = RGBCOLOR(220, 220, 220);
[cell addSubview:lineView];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// PGProductMode.h
// YHB_Prj
//
// Created by Johnny's on 15/9/10.
// Copyright (c) 2015年 striveliu. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface PGProductList : NSObject
@property (nonatomic, strong) NSMutableArray *productList;
- (void)unPacketData:(NSDictionary *)aDataDict;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// PGProductMode.m
// YHB_Prj
//
// Created by Johnny's on 15/9/10.
// Copyright (c) 2015年 striveliu. All rights reserved.
//

#import "PGProductList.h"
#import "SPGLProductMode.h"

@implementation PGProductList

- (instancetype)init
{
if(self = [super init]){
self.productList = [NSMutableArray arrayWithCapacity:0];
}
return self;
}

- (void)unPacketData:(NSDictionary *)aDataDict
{
NSArray *arry = [aDataDict objectForKey:@"rows"];
if(arry && arry.count > 0)
{
for(NSDictionary *dict in arry)
{
SPGLProductMode *mode = [[SPGLProductMode alloc] init];
[mode unPacketData:dict];
[self.productList addObject:mode];
}
}
}


@end
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#import "ProblemGoodsCell.h"
#import "PGRows.h"
#import "SPGLProductMode.h"

@implementation ProblemGoodsCell

Expand All @@ -20,16 +20,16 @@ +(CGFloat)heightForCell
return 110;
}

- (void)setCellWithMode:(PGRows *)aMode
- (void)setCellWithMode:(SPGLProductMode *)aMode
{
[self resetCell];
self.labelInPrice.text=[NSString stringWithFormat:@"%.2f",aMode.buyingPrice];
self.labelName.text=aMode.productName;
self.labelNum.text=[NSString stringWithFormat:@"%.f",aMode.stockQty];
self.labelOdd.text=[NSString stringWithFormat:@"%.f",aMode.productCode];
self.labelOutPrice.text=[NSString stringWithFormat:@"%.2f",aMode.salePrice];
self.labelInPrice.text=[NSString stringWithFormat:@"%.2f",[aMode.strBuyingPrice floatValue]];
self.labelName.text=aMode.strProductName;
self.labelNum.text=[NSString stringWithFormat:@"%.f",[aMode.strStayQty floatValue]];
self.labelOdd.text=[NSString stringWithFormat:@"%.f",[aMode.strProductCode floatValue]];
self.labelOutPrice.text=[NSString stringWithFormat:@"%.2f",[aMode.strSalePrice floatValue]];
// self.labelStatus.text=@"";
self.labelType.text=aMode.clsName;
self.labelType.text=aMode.strClsName;
}

- (void)resetCell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import "ProblemGoodsManager.h"
#import "NetManager.h"
#import "PGResult.h"
#import "PGProductList.h"

@interface ProblemGoodsManager()
{
Expand All @@ -34,9 +34,10 @@ -(void)getProblemGoodsListWithFinishBlock:(void (^)(NSArray *))FBlock isRefresh:
if ([str isEqualToString:@"success"])
{
NSDictionary *resultDict = successDict[@"result"];
PGResult *result = [PGResult modelObjectWithDictionary:resultDict];
PGProductList *result = [[PGProductList alloc] init];
[result unPacketData:resultDict];
_currentPage++;
FBlock(result.rows);
FBlock(result.productList);
}
else
{
Expand Down
1 change: 1 addition & 0 deletions YHB_Prj/YHB_Prj/shangpinguanli/SPGLProductMode.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
@property (nonatomic, strong) NSString *strUid;

@property (nonatomic, strong) NSMutableArray *picList;
- (void)unPacketData:(NSDictionary *)aDataDict;
@end


Expand Down

0 comments on commit 5078ff0

Please sign in to comment.