| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- //
- // AuctionGoodsCell.m
- // BuguLive
- //
- // Created by 王珂 on 16/10/11.
- // Copyright © 2016年 xfg. All rights reserved.
- //
- #import "AuctionGoodsCell.h"
- #import "ShopGoodsModel.h"
- @interface AuctionGoodsCell()
- {
- NetHttpsManager *_httpsManager;
- }
- @property (weak, nonatomic) IBOutlet UIImageView *goodsImageView;
- @property (weak, nonatomic) IBOutlet UILabel *titleLabel;
- @property (weak, nonatomic) IBOutlet UILabel *desLabel;
- @property (weak, nonatomic) IBOutlet UIImageView *diamondsImgView;
- @property (weak, nonatomic) IBOutlet UILabel *priceLabel;
- @property (weak, nonatomic) IBOutlet UILabel *lineLabel;
- @property (weak, nonatomic) IBOutlet UIButton *toSetAuctionButton;
- @end
- @implementation AuctionGoodsCell
- + (instancetype)cellWithTableView:(UITableView *)tableView
- {
- static NSString * cellID = @"AuctionGoodsCell";
- AuctionGoodsCell * cell = [tableView dequeueReusableCellWithIdentifier:cellID];
- if (cell== nil) {
- cell = [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([AuctionGoodsCell class]) owner:nil options:nil] lastObject];;
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- }
- return cell;
- }
- - (void)awakeFromNib
- {
- [super awakeFromNib];
- _goodsImageView.clipsToBounds = YES;
- _titleLabel.font = kAppMiddleTextFont;
- _titleLabel.textColor = kAppGrayColor1;
- _desLabel.textColor = kAppGrayColor3;
- _desLabel.hidden = YES;
- _desLabel.font = kAppSmallTextFont;
- _priceLabel.textColor = kAppGrayColor1;
- _priceLabel.font = kAppSmallTextFont;
- _toSetAuctionButton.layer.cornerRadius = 13;
- _toSetAuctionButton.layer.masksToBounds = YES;
- _toSetAuctionButton.backgroundColor = kAppMainColor;
- [_toSetAuctionButton setTitleColor:kWhiteColor forState:UIControlStateNormal];
- [_toSetAuctionButton setTitle:ASLocalizedString(@"设为拍卖")forState:UIControlStateNormal];
- _toSetAuctionButton.titleLabel.font = kAppSmallTextFont;
- _lineLabel.backgroundColor = kAppSpaceColor;
- }
- - (void)setModel:(ShopGoodsModel *)model
- {
- _model = model;
- [_goodsImageView sd_setImageWithURL:[NSURL URLWithString:model.imgs[0]] placeholderImage:[UIImage imageNamed:@"DefaultImg"]];
- _titleLabel.text = model.name;
- if (model.descStr.length > 0)
- {
- _desLabel.hidden = NO;
- _desLabel.text = model.descStr;
- }
- else
- {
- _desLabel.hidden = YES;
- }
- _priceLabel.text = model.price;
- }
- //设为拍卖
- - (IBAction)clickButton:(id)sender
- {
- if (_delegate && [_delegate respondsToSelector:@selector(clickAuctionWithAuctionGoodsCell:)])
- {
- [_delegate clickAuctionWithAuctionGoodsCell:self];
- }
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
-
- // Configure the view for the selected state
- }
- @end
|