| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- //
- // InventoryAnalysisSearchCel.m
- // IBOSS
- //
- // Created by ssl on 2018/1/4.
- // Copyright © 2018年 elongtian. All rights reserved.
- //
- #import "InventoryAnalysisSearchCel.h"
- @implementation InventoryAnalysisSearchCel
- /**
- 加载xib
- */
- - (void)awakeFromNib {
- [super awakeFromNib];
- }
- #pragma 委托函数
- /**
- 单元格高度
- @return <#return value description#>
- */
- - (CGFloat)cellHeight {
- return 280.0f;
- }
- /**
- 加载tableviewcell
- @param indexPath <#indexPath description#>
- @return <#return value description#>
- */
- + (instancetype)createCellWithIndexPath:(NSIndexPath *)indexPath {
- InventoryAnalysisSearchCel *cell = [[NSBundle mainBundle] loadNibNamed:@"InventoryAnalysisSearchCel" owner:nil options:nil][0];
- return cell;
- }
- /**
- 初始化cell数据
-
- @param model <#model description#>
- @param indexPath <#indexPath description#>
- */
- - (void)updateCellWithModel:(SideSlipModel *__autoreleasing *)model
- indexPath:(NSIndexPath *)indexPath {
- _slideModel = *model;
- _mutDict = [NSMutableDictionary dictionaryWithDictionary:_slideModel.customDict];
- _searchModel = [InventoryAnalysisSearchModel new];
- [self selectBtn:self.btnKind unSelected:self.btnBrand];
- [self updateModel];
- }
- /**
- 返回tableviewcell标识
-
- @return <#return value description#>
- */
- + (NSString *)cellReuseIdentifier {
- return @"SearchTableViewCell";
- }
- /**
- 品牌
- @param sender <#sender description#>
- */
- - (IBAction)selectBrand:(id)sender {
- if(self.btnBrand.tag == 0){
- [self selectBtn:self.btnBrand unSelected:self.btnKind];
- [self updateModel];
- }
- }
- /**
- 种类
- @param sender <#sender description#>
- */
- - (IBAction)selectKind:(id)sender {
- if(self.btnKind.tag == 0){
- [self selectBtn:self.btnKind unSelected:self.btnBrand];
- [self updateModel];
- }
- }
- /**
- 改变状态
- @param selectBtn <#selectBtn description#>
- @param unSelecteBtn <#unSelecteBtn description#>
- */
- -(void) selectBtn:(UIButton *) selectBtn unSelected:(UIButton *) unSelecteBtn{
- selectBtn.layer.cornerRadius = 10;
- [selectBtn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
- selectBtn.layer.borderColor = [[UIColor redColor] CGColor];
- selectBtn.layer.borderWidth =1;
- selectBtn.tag = 1;
- unSelecteBtn.layer.cornerRadius = 10;
- [unSelecteBtn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
- unSelecteBtn.layer.borderColor = [[UIColor grayColor] CGColor];
- unSelecteBtn.layer.borderWidth =1;
- unSelecteBtn.tag = 0;
- }
- /**
- 确定按钮回调
- */
- - (void)updateModel{
- InventoryAnalysisSearchModel *model = [[InventoryAnalysisSearchModel alloc] init];
- if(self.btnKind.tag == 1){
- model.OperateType = @"1";
- }else{
- model.OperateType = @"2";
- }
- NSMutableDictionary *mutDict = [NSMutableDictionary dictionaryWithDictionary:_slideModel.customDict];
- [mutDict setValue:model forKey:INVENTORY_ANALYSIS_SEARCH];
- _slideModel.customDict = [mutDict copy];
- }
- @end
|