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
bc97f64a
Commit
bc97f64a
authored
Jun 02, 2016
by
勾芒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
330971f1
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
132 additions
and
77 deletions
+132
-77
ProductLibraryViewController.m
Lighting/Class/ProductLibraryViewController.m
+7
-1
StoryboardwithCYX.storyboard
Lighting/Lighting/StoryboardwithCYX.storyboard
+1
-1
ProductScreeningCollectionViewCell.h
Lighting/Tools/ProductScreeningCollectionViewCell.h
+6
-1
ProductScreeningCollectionViewCell.m
Lighting/Tools/ProductScreeningCollectionViewCell.m
+9
-4
SceneSectionHeaderView.m
Lighting/Tools/SceneSectionHeaderView.m
+5
-0
SceneViewController.m
Lighting/Tools/SceneViewController.m
+102
-68
ScreeningTableViewCell.m
Lighting/Tools/ScreeningTableViewCell.m
+2
-2
No files found.
Lighting/Class/ProductLibraryViewController.m
View file @
bc97f64a
...
...
@@ -281,7 +281,6 @@
NSArray
*
spacrArray
=
[
weakSelf
.
selectedCode
componentsSeparatedByString
:
@"到"
];
weakSelf
.
condtionModel
.
startprice
=
[
NSNumber
numberWithInteger
:[[
spacrArray
objectAtIndex_opple
:
0
]
integerValue
]];
weakSelf
.
condtionModel
.
endprice
=
[
NSNumber
numberWithInteger
:[[
spacrArray
objectAtIndex_opple
:
1
]
integerValue
]];
weakSelf
.
condtionModel
.
categoryEquals
=
_selectedCode
;
}
break
;
...
...
@@ -616,6 +615,13 @@
self
.
selectedCode
=
title
;
}
else
{
self
.
condtionModel
.
styleEquals
=
nil
;
self
.
condtionModel
.
spaceEquals
=
nil
;
self
.
condtionModel
.
categoryEquals
=
nil
;
self
.
condtionModel
.
startprice
=
nil
;
self
.
condtionModel
.
endprice
=
nil
;
self
.
condtionModel
.
materialEqueals
=
nil
;
self
.
selectedCode
=
typecode
;
}
[
self
.
productCollectionView
.
mj_header
beginRefreshing
];
...
...
Lighting/Lighting/StoryboardwithCYX.storyboard
View file @
bc97f64a
...
...
@@ -3477,7 +3477,7 @@
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"236"
height=
"210"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<subviews>
<imageView
userInteractionEnabled=
"NO"
contentMode=
"scaleToFill"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
id=
"Wom-Bb-RIf"
>
<imageView
userInteractionEnabled=
"NO"
contentMode=
"scaleToFill"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
i
mage=
"登录"
i
d=
"Wom-Bb-RIf"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"236"
height=
"125"
/>
<autoresizingMask
key=
"autoresizingMask"
widthSizable=
"YES"
heightSizable=
"YES"
/>
<color
key=
"backgroundColor"
red=
"0.9882352941176471"
green=
"0.97254901960784312"
blue=
"0.93725490196078431"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
...
...
Lighting/Tools/ProductScreeningCollectionViewCell.h
View file @
bc97f64a
...
...
@@ -7,7 +7,7 @@
//
#import <UIKit/UIKit.h>
#import "TOGoodsEntityModel.h"
@interface
ProductScreeningCollectionViewCell
:
UICollectionViewCell
...
...
@@ -31,4 +31,9 @@
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
goodsPrice
;
/**
* 数据源
*/
@property
(
nonatomic
,
strong
)
TOGoodsEntityModel
*
model
;
@end
Lighting/Tools/ProductScreeningCollectionViewCell.m
View file @
bc97f64a
...
...
@@ -10,9 +10,14 @@
@implementation
ProductScreeningCollectionViewCell
/**
* 商品图片
*/
-
(
void
)
setModel
:(
TOGoodsEntityModel
*
)
model
{
_model
=
model
;
NSArray
*
images
=
[
_model
.
pictures
componentsSeparatedByString
:
@","
];
[
self
.
goodsImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:[
images
firstObject
]]
placeholderImage
:
REPLACEIMAGE
];
self
.
goodsName
.
text
=
_model
.
name
;
self
.
goodsSpecifications
.
text
=
_model
.
code
;
self
.
goodsPrice
.
text
=
[
NSString
stringWithFormat
:
@"¥%@"
,[
_model
.
tagPrice
stringValue
]];
}
@end
Lighting/Tools/SceneSectionHeaderView.m
View file @
bc97f64a
...
...
@@ -34,6 +34,11 @@
UIView
*
lineView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
54
,
100
,
1
)];
lineView
.
backgroundColor
=
kTCColor
(
221
,
221
,
221
);
[
self
addSubview
:
lineView
];
//横线
UIView
*
newLineView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
100
,
1
)];
newLineView
.
backgroundColor
=
kTCColor
(
221
,
221
,
221
);
[
self
addSubview
:
newLineView
];
}
return
self
;
}
...
...
Lighting/Tools/SceneViewController.m
View file @
bc97f64a
...
...
@@ -81,6 +81,16 @@
*/
@property
(
nonatomic
,
assign
)
NSInteger
selectedSectionNumber
;
/**
* 管理section开关(0,表示关闭,1,表示开启)
*/
@property
(
nonatomic
,
strong
)
NSMutableArray
*
openArray
;
/**
* 选中code
*/
@property
(
nonatomic
,
copy
)
NSString
*
selectedCode
;
@end
@implementation
SceneViewController
...
...
@@ -141,6 +151,15 @@
return
_productScreeningDatasArray
;
}
-
(
NSMutableArray
*
)
openArray
{
if
(
!
_openArray
)
{
_openArray
=
[
NSMutableArray
array
];
}
return
_openArray
;
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
...
...
@@ -158,10 +177,6 @@
//产品
[
self
GetdatasAction
];
}
}
#pragma mark -UI
...
...
@@ -197,10 +212,18 @@
self
.
myTableViewBackView
.
layer
.
masksToBounds
=
NO
;
//数据列表UICollectionView
if
(
self
.
isScene
)
{
self
.
collectionViewLayout
.
itemSize
=
CGSizeMake
((
self
.
sceneOrProductClollectionView
.
mj_w
-
40
)
/
3
,
(
self
.
sceneOrProductClollectionView
.
mj_w
-
40
)
/
4
);
self
.
collectionViewLayout
.
minimumLineSpacing
=
10
;
self
.
collectionViewLayout
.
minimumInteritemSpacing
=
10
;
self
.
collectionViewLayout
.
sectionInset
=
UIEdgeInsetsMake
(
10
,
10
,
10
,
10
);
}
else
{
self
.
collectionViewLayout
.
itemSize
=
CGSizeMake
((
self
.
sceneOrProductClollectionView
.
mj_w
-
40
)
/
3
,
self
.
sceneOrProductClollectionView
.
mj_w
/
3
);
self
.
collectionViewLayout
.
minimumLineSpacing
=
10
;
self
.
collectionViewLayout
.
minimumInteritemSpacing
=
10
;
self
.
collectionViewLayout
.
sectionInset
=
UIEdgeInsetsMake
(
10
,
10
,
10
,
10
);
}
self
.
sceneOrProductClollectionView
.
dataSource
=
self
;
self
.
sceneOrProductClollectionView
.
delegate
=
self
;
}
...
...
@@ -269,7 +292,7 @@
//上拉加载
self
.
sceneOrProductClollectionView
.
mj_footer
=
[
MJRefreshAutoNormalFooter
footerWithRefreshingBlock
:
^
{
if
(
self
.
indexPage
++
>
self
.
totalPages
)
{
if
(
++
self
.
indexPage
>
self
.
totalPages
)
{
[
self
.
sceneOrProductClollectionView
.
mj_footer
endRefreshingWithNoMoreData
];
}
else
...
...
@@ -342,41 +365,6 @@
Newpage
.
rows
=
KROWS
;
self
.
goodsModel
.
page
=
Newpage
;
self
.
indexPage
=
1
;
//搜索
switch
(
self
.
rightSelectedIndex
)
{
case
0
:
//风格
{
// self.goodsModel.styleEquals = self.selectedCode;
}
break
;
case
1
:
//类型
{
// self.goodsModel.categoryEquals = self.selectedCode;
}
break
;
case
2
:
//空间
{
// self.goodsModel.spaceEquals = self.selectedCode;
}
break
;
case
3
:
//材质
{
// self.goodsModel.materialEqueals = self.selectedCode;
}
break
;
case
4
:
//价格
{
//价格字符串切割
// NSArray *spacrArray = [self.selectedCode componentsSeparatedByString:@"到"];
// self.condtionModel.startprice = [NSNumber numberWithInteger:[[spacrArray objectAtIndex_opple:0] integerValue]];
// self.condtionModel.endprice = [NSNumber numberWithInteger:[[spacrArray objectAtIndex_opple:1] integerValue]];
}
break
;
default:
break
;
}
[
self
.
sceneOrProductClollectionView
.
mj_footer
resetNoMoreData
];
[
self
getGoodsListDatasisRemove
:
YES
Withobject
:
self
.
goodsModel
];
}];
...
...
@@ -389,7 +377,7 @@
self
.
sceneOrProductClollectionView
.
mj_footer
=
[
MJRefreshAutoNormalFooter
footerWithRefreshingBlock
:
^
{
if
(
self
.
indexPage
++
>
self
.
totalPages
)
{
if
(
++
self
.
indexPage
>
self
.
totalPages
)
{
[
self
.
sceneOrProductClollectionView
.
mj_footer
endRefreshingWithNoMoreData
];
}
else
{
...
...
@@ -454,6 +442,7 @@
newModel
.
name
=
model
.
name
;
newModel
.
children
=
model
.
children
;
newModel
.
isSelectedState
=
NO
;
[
self
.
openArray
addObject
:
@"0"
];
//section关闭状态;
[[
self
.
productScreeningDatasArray
objectAtIndex_opple
:
2
]
addObject
:
newModel
];
}
for
(
DataDict
*
model
in
goodsScreening
.
material
)
{
...
...
@@ -580,9 +569,11 @@
#pragma mark - UITableViewDataSource代理
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
if
(
se
ction
==
self
.
selectedSectionNumber
)
{
if
(
se
lf
.
rightSelectedIndex
==
2
)
{
return
self
.
sectionCellNumber
;
BOOL
boolValue
=
[[
self
.
openArray
objectAtIndex_opple
:
section
]
boolValue
];
GoodsCategoryModel
*
model
=
[[
self
.
productScreeningDatasArray
objectAtIndex_opple
:
self
.
rightSelectedIndex
]
objectAtIndex_opple
:
section
];
return
boolValue
?
model
.
children
.
count
:
0
;
}
return
0
;
}
...
...
@@ -606,6 +597,8 @@
ScreeningTableViewCell
*
cell
=
[
tableView
cellForRowAtIndexPath
:
indexPath
];
cell
.
screeningLabe
.
backgroundColor
=
kTCColor
(
221
,
221
,
221
);
cell
.
screeningLabe
.
textColor
=
kMainBlueColor
;
self
.
goodsModel
.
categoryEquals
=
[[[
self
.
productScreeningDatasArray
objectAtIndex_opple
:
self
.
rightSelectedIndex
]
objectAtIndex_opple
:
indexPath
.
row
]
fid
];
[
self
.
sceneOrProductClollectionView
.
mj_header
beginRefreshing
];
}
...
...
@@ -641,24 +634,46 @@
}
#pragma mark -区头选中
-
(
void
)
SectionButtonClickAction
:
(
UIButton
*
)
button
{
[
self
CancelTableviewSectionState
];
if
(
self
.
rightSelectedIndex
!=
2
)
{
button
.
selected
=
YES
;
button
.
backgroundColor
=
kTCColor
(
221
,
221
,
221
);
}
//清空状态
self
.
goodsModel
.
styleEquals
=
nil
;
self
.
goodsModel
.
spaceEquals
=
nil
;
self
.
goodsModel
.
categoryEquals
=
nil
;
self
.
goodsModel
.
startprice
=
nil
;
self
.
goodsModel
.
endprice
=
nil
;
self
.
goodsModel
.
materialEqueals
=
nil
;
switch
(
self
.
rightSelectedIndex
)
{
case
0
:
//风格
{
if
(
self
.
isScene
)
{
self
.
conditionModel
.
styleEquals
=
[[[
self
.
sceneScreeningDatasArray
objectAtIndex_opple
:
self
.
rightSelectedIndex
]
objectAtIndex_opple
:
button
.
tag
-
100
]
typecode
];
self
.
conditionModel
.
spaceEquals
=
nil
;
}
else
{
self
.
goodsModel
.
styleEquals
=
[[[
self
.
productScreeningDatasArray
objectAtIndex_opple
:
self
.
rightSelectedIndex
]
objectAtIndex_opple
:
button
.
tag
-
100
]
typecode
];
}
}
break
;
case
1
:
//空间
{
if
(
self
.
isScene
)
{
self
.
conditionModel
.
spaceEquals
=
[[[
self
.
sceneScreeningDatasArray
objectAtIndex_opple
:
self
.
rightSelectedIndex
]
objectAtIndex_opple
:
button
.
tag
-
100
]
typecode
];
self
.
conditionModel
.
styleEquals
=
nil
;
}
else
{
self
.
goodsModel
.
spaceEquals
=
[[[
self
.
productScreeningDatasArray
objectAtIndex_opple
:
self
.
rightSelectedIndex
]
objectAtIndex_opple
:
button
.
tag
-
100
]
typecode
];
}
}
break
;
case
2
:
//类型
...
...
@@ -668,12 +683,15 @@
break
;
case
3
:
//材质
{
self
.
goodsModel
.
materialEqueals
=
[[[
self
.
productScreeningDatasArray
objectAtIndex_opple
:
self
.
rightSelectedIndex
]
objectAtIndex_opple
:
button
.
tag
-
100
]
typecode
];
}
break
;
case
4
:
//价格
{
//价格字符串切割
NSArray
*
spacrArray
=
[[[[
self
.
productScreeningDatasArray
objectAtIndex_opple
:
self
.
rightSelectedIndex
]
objectAtIndex_opple
:
button
.
tag
-
100
]
typename
]
componentsSeparatedByString
:
@"到"
];
self
.
goodsModel
.
startprice
=
[
NSNumber
numberWithInteger
:[[
spacrArray
objectAtIndex_opple
:
0
]
integerValue
]];
self
.
goodsModel
.
endprice
=
[
NSNumber
numberWithInteger
:[[
spacrArray
objectAtIndex_opple
:
1
]
integerValue
]];
}
break
;
...
...
@@ -682,18 +700,19 @@
}
if
(
self
.
rightSelectedIndex
==
2
)
{
GoodsCategoryModel
*
model
=
[
self
.
productScreeningDatasArray
objectAtIndex_opple
:
self
.
rightSelectedIndex
][
button
.
tag
-
100
];
self
.
sectionCellNumber
=
model
.
children
.
count
;
self
.
selectedSectionNumber
=
button
.
tag
-
100
;
[
self
.
screeningTableView
reloadData
];
// NSIndexSet *index = [[NSIndexSet alloc]initWithIndex:button.tag-100];
// [self.screeningTableView reloadSections:index withRowAnimation:UITableViewRowAnimationFade];
BOOL
boolValue
=
[[
self
.
openArray
objectAtIndex_opple
:
button
.
tag
-
100
]
boolValue
];
NSMutableIndexSet
*
index
=
[[
NSMutableIndexSet
alloc
]
init
];
for
(
int
i
=
0
;
i
<
self
.
openArray
.
count
;
i
++
)
{
[
self
.
openArray
replaceObjectAtIndex
:
i
withObject
:
@"0"
];
[
index
addIndex
:
i
];
}
[
self
.
openArray
replaceObjectAtIndex
:
button
.
tag
-
100
withObject
:
boolValue
?
@"0"
:
@"1"
];
[
self
.
screeningTableView
reloadSections
:
index
withRowAnimation
:
UITableViewRowAnimationFade
];
}
else
{
self
.
sectionCellNumber
=
0
;
[
self
.
sceneOrProductClollectionView
.
mj_header
beginRefreshing
];
}
}
...
...
@@ -702,7 +721,18 @@
-
(
void
)
CancelTableviewSectionState
{
NSArray
*
array
=
[
self
.
isScene
?
self
.
sceneScreeningDatasArray
:
self
.
productScreeningDatasArray
objectAtIndex_opple
:
self
.
rightSelectedIndex
];
NSArray
*
array
=
nil
;
if
(
self
.
isScene
)
{
array
=
[
self
.
sceneScreeningDatasArray
objectAtIndex_opple
:
self
.
rightSelectedIndex
];
}
else
{
if
(
self
.
rightSelectedIndex
==
2
)
{
array
=
[[
self
.
productScreeningDatasArray
objectAtIndex_opple
:
self
.
rightSelectedIndex
]
firstObject
];
}
else
{
array
=
[
self
.
productScreeningDatasArray
objectAtIndex_opple
:
self
.
rightSelectedIndex
];
}
}
for
(
int
i
=
0
;
i
<
array
.
count
;
i
++
)
{
SceneSectionHeaderView
*
sectionView
=
[
self
.
screeningTableView
headerViewForSection
:
i
];
sectionView
.
sectionButton
.
selected
=
NO
;
...
...
@@ -738,6 +768,7 @@
{
ProductScreeningCollectionViewCell
*
cell
=
[
collectionView
dequeueReusableCellWithReuseIdentifier
:
@"ProductCollectionViewCell"
forIndexPath
:
indexPath
];
cell
.
backgroundColor
=
kMainGrayColor
;
cell
.
model
=
[
self
.
productDatasArray
objectAtIndex_opple
:
indexPath
.
item
];
return
cell
;
}
}
...
...
@@ -804,6 +835,9 @@
break
;
}
for
(
int
i
=
0
;
i
<
self
.
openArray
.
count
;
i
++
)
{
[
self
.
openArray
replaceObjectAtIndex
:
i
withObject
:
@"0"
];
}
self
.
rightSelectedIndex
=
sender
.
tag
-
100
;
[
self
RemoveAllButtonisSelected
];
[
self
CancelTableviewSectionState
];
...
...
Lighting/Tools/ScreeningTableViewCell.m
View file @
bc97f64a
...
...
@@ -21,8 +21,8 @@
if
(
self
=
[
super
initWithStyle
:
style
reuseIdentifier
:
reuseIdentifier
])
{
self
.
screeningLabe
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
100
,
55
)];
self
.
screeningLabe
.
textColor
=
k
TCColor
(
170
,
170
,
170
)
;
self
.
screeningLabe
.
font
=
[
UIFont
systemFontOfSize
:
1
3
];
self
.
screeningLabe
.
textColor
=
k
MainBlueColor
;
self
.
screeningLabe
.
font
=
[
UIFont
systemFontOfSize
:
1
0
];
self
.
screeningLabe
.
textAlignment
=
NSTextAlignmentCenter
;
[
self
.
contentView
addSubview
:
self
.
screeningLabe
];
}
...
...
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