Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
Opple-iOS
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
Opple-iOS
Commits
eabd8a46
Commit
eabd8a46
authored
9 years ago
by
zhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
今天进度 商品接口调试 场景库点选添加背景,产品没拿到数据
parent
ba95f88f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
30 deletions
+55
-30
ProductLibraryView.h
Lighting/Class/ProductLibraryView.h
+3
-2
ProductLibraryView.m
Lighting/Class/ProductLibraryView.m
+52
-28
No files found.
Lighting/Class/ProductLibraryView.h
View file @
eabd8a46
...
...
@@ -28,7 +28,7 @@ UICollectionViewDelegate,UICollectionViewDelegateFlowLayout>
@property
(
nonatomic
,
strong
)
UIButton
*
fengGeBtn
;
@property
(
nonatomic
,
strong
)
UIButton
*
leiXingBtn
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
nameData
;
@property
(
nonatomic
,
strong
)
NS
MutableArray
*
arrayData
;
@property
(
nonatomic
,
strong
)
NS
Array
*
arrayData
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
array1
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
array2
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
array3
;
...
...
@@ -37,10 +37,11 @@ UICollectionViewDelegate,UICollectionViewDelegateFlowLayout>
* 筛选数据源
*/
@property
(
nonatomic
,
strong
)
NSMutableArray
*
screeningDatas
;
@property
(
nonatomic
,
strong
)
GoodsFilter
*
goodsFilter
;
/**
* 商品数据源对象
*/
@property
(
nonatomic
,
strong
)
GoodsResponse
*
datasArray
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
datasArray
;
/**
* 商品iD
*/
...
...
This diff is collapsed.
Click to expand it.
Lighting/Class/ProductLibraryView.m
View file @
eabd8a46
...
...
@@ -8,7 +8,19 @@
#import "ProductLibraryView.h"
@implementation
ProductLibraryView
/**
* 初始化商品数据源数组
*/
-
(
NSMutableArray
*
)
datasArray
{
if
(
_datasArray
==
nil
)
{
_datasArray
=
[
NSMutableArray
array
];
}
return
_datasArray
;
}
-
(
void
)
viewDidLoad
{
[
self
initdata
];
[
self
getScreeningdatas
];
...
...
@@ -38,11 +50,8 @@
-
(
void
)
initdata
{
self
.
arrayData
=
[[
NSMutableArray
alloc
]
init
];
self
.
nameData
=
[[
NSMutableArray
alloc
]
initWithObjects
:
@"风格"
,
@"类型"
,
@"空间"
,
@"材质"
,
@"价格"
,
@""
,
@"高级"
,
nil
];
self
.
array1
=
[[
NSMutableArray
alloc
]
initWithObjects
:
@"吊灯"
,
@"壁灯"
,
@"台灯"
,
@"落地灯"
,
@"吸顶灯"
,
@"镜前灯"
,
@"烛台灯"
,
@"过厅灯"
,
@"过道灯"
,
@"商业照明"
,
@"家具饰品"
,
@"其他"
,
nil
];
self
.
array2
=
[[
NSMutableArray
alloc
]
initWithObjects
:
@"水晶系列"
,
@"金属系列"
,
@"商照电工"
,
@"陶瓷"
,
@"木艺"
,
@"其它"
,
nil
];
self
.
array3
=
[[
NSMutableArray
alloc
]
initWithObjects
:
@"田园"
,
@"宫廷"
,
@"乡村"
,
@"日式风格"
,
@"欧式风格"
,
@"混搭风格"
,
@"现代简约"
,
nil
];
self
.
arrayData
=
self
.
array3
;
self
.
nameData
=
[[
NSMutableArray
alloc
]
initWithObjects
:
@"风格"
,
@"类型"
,
@"空间"
,
@"材质"
,
@"价格"
,
nil
];
}
//#pragma mark -热门搜索
//- (void)setSelectedCode:(NSString *)selectedCode
...
...
@@ -91,7 +100,11 @@
}
else
{
weakSelf
.
datasArray
=
response
;
for
(
TOGoodsEntity
*
model
in
response
.
goodsEntity
)
{
[
self
.
datasArray
addObject
:
model
];
}
// [weakSelf.productCollectionView reloadData];
}
}];
...
...
@@ -106,11 +119,9 @@
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
GoodsFilter
*
goodsStyle
=
[[
GoodsFilter
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
[
self
.
screeningDatas
addObject
:
goodsStyle
.
styles
];
[
self
.
screeningDatas
addObject
:
goodsStyle
.
categories
];
[
self
.
screeningDatas
addObject
:
goodsStyle
.
space
];
[
self
.
screeningDatas
addObject
:
goodsStyle
.
material
];
[
self
.
screeningDatas
addObject
:
goodsStyle
.
price
];
self
.
goodsFilter
=
goodsStyle
;
self
.
arrayData
=
self
.
goodsFilter
.
styles
;
[
self
.
seceneTableView
reloadData
];
}
else
{
...
...
@@ -189,15 +200,15 @@
for
(
int
i
=
0
;
i
<
self
.
nameData
.
count
;
i
++
)
{
if
(
i
!=
5
)
{
UIButton
*
btn
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
btn
.
frame
=
CGRectMake
(
ScreenWidth
-
190
,
52
+
i
*
50
,
5
0
,
46
)
;
btn
.
frame
=
CGRectMake
(
ScreenWidth
-
250
,
52
+
i
*
50
,
10
0
,
46
)
;
btn
.
backgroundColor
=
[
UIColor
whiteColor
];
[
btn
setTitle
:[
self
.
nameData
objectAtIndex
:
i
]
forState
:
UIControlStateNormal
];
btn
.
contentEdgeInsets
=
UIEdgeInsetsMake
(
0
,
40
,
0
,
0
);
[
btn
setTitleColor
:[
UIColor
blackColor
]
forState
:
UIControlStateNormal
];
// btn.contentEdgeInsets = UIEdgeInsetsMake(0, 60, 0, 0);
[
btn
addTarget
:
self
action
:
@selector
(
selectedType
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
btn
.
tag
=
100
+
i
;
btn
.
layer
.
masksToBounds
=
YES
;
btn
.
layer
.
cornerRadius
=
2
3
;
btn
.
layer
.
cornerRadius
=
2
5
;
[
self
.
view
addSubview
:
btn
];
}
...
...
@@ -256,28 +267,25 @@
switch
(
sender
.
tag
)
{
case
100
:
// 风格
self
.
arrayData
=
self
.
array3
;
self
.
arrayData
=
self
.
goodsFilter
.
styles
;
break
;
case
101
:
// 类型
self
.
arrayData
=
self
.
array2
;
self
.
arrayData
=
self
.
goodsFilter
.
categories
;
break
;
case
102
:
// 空间
self
.
arrayData
=
self
.
array1
;
self
.
arrayData
=
self
.
goodsFilter
.
space
;
break
;
case
103
:
// 材质
self
.
arrayData
=
self
.
array3
;
self
.
arrayData
=
self
.
goodsFilter
.
material
;
break
;
case
104
:
// 价格
self
.
arrayData
=
self
.
array3
;
break
;
case
106
:
// 高级
self
.
arrayData
=
self
.
array3
;
self
.
arrayData
=
self
.
goodsFilter
.
price
;
break
;
default
:
break
;
}
...
...
@@ -287,7 +295,17 @@
//定义展示的Section的个数
-
(
NSInteger
)
numberOfSectionsInCollectionView
:
(
UICollectionView
*
)
collectionView
{
return
10
;
if
(
self
.
datasArray
.
count
/
3
==
0
&&
self
.
datasArray
.
count
%
3
!=
0
)
{
return
1
;
}
else
{
if
(
self
.
datasArray
.
count
%
3
==
0
)
{
return
self
.
datasArray
.
count
/
3
;
}
else
{
return
self
.
datasArray
.
count
/
3
+
1
;
}
}
}
//定义展示的UICollectionViewCell的个数
-
(
NSInteger
)
collectionView
:
(
UICollectionView
*
)
collectionView
numberOfItemsInSection
:
(
NSInteger
)
section
...
...
@@ -300,6 +318,7 @@
{
static
NSString
*
CellIdentifier
=
@"UICollectionViewCell"
;
ProductCollectionPictureCell
*
cell
=
(
ProductCollectionPictureCell
*
)[
collectionView
dequeueReusableCellWithReuseIdentifier
:
CellIdentifier
forIndexPath
:
indexPath
];
[
cell
.
productImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:[[
self
.
datasArray
objectAtIndex_opple
:
indexPath
.
row
]
pictures
]]
placeholderImage
:
REPLACEIMAGE
];
return
cell
;
...
...
@@ -376,8 +395,13 @@
cell
=
[[
UITableViewCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
cellID
];
}
if
([[
self
.
arrayData
objectAtIndex_opple
:
indexPath
.
row
]
isKindOfClass
:[
GoodsCategory
class
]])
{
cell
.
textLabel
.
text
=
[[
self
.
arrayData
objectAtIndex_opple
:
indexPath
.
row
]
name
];
}
else
{
//类型是多级的这里要改动
cell
.
textLabel
.
text
=
[[
self
.
arrayData
objectAtIndex_opple
:
indexPath
.
row
]
typename
];
}
cell
.
textLabel
.
text
=
[
self
.
arrayData
objectAtIndex
:
indexPath
.
row
];
// 05产品库-详情_03
return
cell
;
...
...
@@ -385,7 +409,7 @@
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
[
self
getGoodsListDatas
];
}
-
(
void
)
DismissScreenView
:
(
UITapGestureRecognizer
*
)
sender
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment