MGShopTableCell.m 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // MGShopTableCell.m
  3. // BuguLive
  4. //
  5. // Created by 宋晨光 on 2020/7/17.
  6. // Copyright © 2020 xfg. All rights reserved.
  7. //
  8. #import "MGShopTableCell.h"
  9. @implementation MGShopTableCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. // Initialization code
  13. self.shopImgView.clipsToBounds = YES;
  14. self.shopImgView.contentMode = UIViewContentModeScaleAspectFill;
  15. self.shopImgView.layer.cornerRadius = 4;
  16. self.shopImgView.layer.masksToBounds = YES;
  17. self.shopBtn.layer.cornerRadius = 30 / 2;
  18. self.shopBtn.layer.masksToBounds = YES;
  19. self.shopBtn.layer.borderColor = [UIColor colorWithHexString:@"AF1328"].CGColor;
  20. self.shopBtn.layer.borderWidth = 0.5f;
  21. }
  22. - (void)resetViewWithModel:(MGShopListModel *)model{
  23. _model = model;
  24. [self.shopImgView sd_setImageWithURL:[NSURL URLWithString:model.shop_logo]];
  25. self.shopNameL.text = model.shop_name;
  26. self.shopNumL.text = model.shop_price;
  27. }
  28. - (IBAction)clickShopBtn:(UIButton *)sender {
  29. if (![_model.shop_url containsString:@"http"]) {
  30. [BGHUDHelper alert:ASLocalizedString(@"URL不合法")];
  31. return;
  32. }
  33. [[UIApplication sharedApplication] openURL:[NSURL URLWithString:_model.shop_url]];
  34. }
  35. @end