/chooseGoods_Attr/ShoppingCar(购物车)/确认订单/Views/ConfirmOrderTableViewCell.m

https://github.com/huazhixi/chooseGoodsAttributesDemo · Objective C · 49 lines · 32 code · 7 blank · 10 comment · 1 complexity · 8f8a895e25303e6eff0ccef66d79498d MD5 · raw file

  1. //
  2. // ConfirmOrderTableViewCell.m
  3. // AiMeiBang
  4. //
  5. // Created by Lingxiu on 16/1/28.
  6. // Copyright © 2016年 zym. All rights reserved.
  7. //
  8. #import "ConfirmOrderTableViewCell.h"
  9. #import "UIImageView+WebCache.h"
  10. #import "BuyCarModel.h"
  11. #import "ACMacros.h"
  12. @interface ConfirmOrderTableViewCell ()
  13. @property (weak, nonatomic) IBOutlet UILabel *shop_nameLbl;
  14. @property (weak, nonatomic) IBOutlet UIImageView *good_imgView;
  15. @property (weak, nonatomic) IBOutlet UILabel *good_nameLbl;
  16. @property (weak, nonatomic) IBOutlet UILabel *shop_priceLbl;
  17. @property (weak, nonatomic) IBOutlet UILabel *numLbl;
  18. @property (weak, nonatomic) IBOutlet UILabel *totalPriceLbl;
  19. @end
  20. @implementation ConfirmOrderTableViewCell
  21. + (instancetype)cellWithTableView:(UITableView *)tableView {
  22. static NSString *ConfirmOrderTableViewCellID = @"ConfirmOrderTableViewCellID";
  23. ConfirmOrderTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ConfirmOrderTableViewCellID];
  24. if (!cell) {
  25. cell = [[NSBundle mainBundle] loadNibNamed:@"ConfirmOrderTableViewCell" owner:self options:nil].lastObject;
  26. }
  27. return cell;
  28. }
  29. - (void)setOrderModel:(BuyCarModel *)orderModel {
  30. _orderModel = orderModel;
  31. [_good_imgView sd_setImageWithURL:[NSURL URLWithString:orderModel.goods_img] placeholderImage:nil];
  32. _good_nameLbl.text = orderModel.goods_name;
  33. _shop_nameLbl.text = orderModel.shop_name;
  34. _shop_priceLbl.text = [NSString stringWithFormat:@"%@元", orderModel.shop_price];
  35. _numLbl.text = [NSString stringWithFormat:@"x%@", orderModel.num];
  36. float totalPrice = [orderModel.shop_price floatValue] * [orderModel.num intValue];
  37. _totalPriceLbl.text = [NSString stringWithFormat:@"%.2f元", totalPrice];
  38. // if (orderModel.postage) {
  39. //
  40. // }
  41. }
  42. @end