《省钱达人》与《猎豆优选》UI相同版。域名tbk

DRGoodDetailModel.m 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. //
  2. // DRGoodDetailModel.m
  3. // YouHuiProject
  4. //
  5. // Created by xiaoxi on 2018/1/24.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "DRGoodDetailModel.h"
  9. #import "DRDetailImgModel.h"
  10. #import "DRCommunityDetailModel.h"
  11. @implementation DRGoodDetailModel
  12. + (NSDictionary<NSString *,id> *)modelCustomPropertyMapper {
  13. return @{@"Id":@"id"};
  14. }
  15. + (NSDictionary *)modelContainerPropertyGenericClass {
  16. return @{@"detail_pic":[DRDetailImgModel class]};
  17. }
  18. //+ (NSDictionary *)modelContainerPropertyGenericClass {
  19. // return @{@"shop":[DRShopModel class]};
  20. //}
  21. -(void)setCommission_price:(NSString *)commission_price{
  22. if ([@"" isEqualToString:commission_price]) {
  23. _commission_price=@"";
  24. }else{
  25. float tmp=[commission_price floatValue];
  26. _commission_price=[NSString stringWithFormat:@"%.2lf",tmp];
  27. }
  28. }
  29. /**
  30. model转换
  31. */
  32. - (void)changeDetailModelWithComunityRightModel:(DRCommunityRightModel *)model {
  33. /*
  34. @"goods_id":self.goodModel.goods_id,
  35. @"is_coupon":self.goodModel.is_coupon,
  36. @"coupon_price":self.goodModel.coupon_price,
  37. @"price":self.goodModel.price,
  38. @"discount_price":self.goodModel.discount_price,
  39. @"commission_rate":self.goodModel.commission_rate,
  40. @"coupon_end_time":coupon_end_time,
  41. @"coupon_start_time":coupon_start_time
  42. **/
  43. self.goods_id = model.goods_id;
  44. self.is_coupon = [NSNumber numberWithInteger:model.is_coupon.integerValue];
  45. self.coupon_price = model.coupon_price;
  46. self.price = model.price;
  47. self.discount_price = model.discount_price;
  48. self.commission_rate = model.commission_rate;
  49. self.start_time = model.start_time;
  50. self.end_time = model.end_time;
  51. }
  52. - (void)changeDetailModelWithComunityModel:(DRCommunityDetailModel *)model {
  53. /*
  54. @"goods_id":self.goodModel.goods_id,
  55. @"is_coupon":self.goodModel.is_coupon,
  56. @"coupon_price":self.goodModel.coupon_price,
  57. @"price":self.goodModel.price,
  58. @"discount_price":self.goodModel.discount_price,
  59. @"commission_rate":self.goodModel.commission_rate,
  60. @"coupon_end_time":coupon_end_time,
  61. @"coupon_start_time":coupon_start_time
  62. **/
  63. self.goods_id = model.goods_id;
  64. self.is_coupon = [NSNumber numberWithInteger:model.is_coupon.integerValue];
  65. self.coupon_price = model.coupon_price;
  66. self.price = model.price;
  67. self.discount_price = model.discount_price;
  68. self.commission_rate = model.commission_rate;
  69. // self.start_time = model.start_time;
  70. // self.end_time = model.end_time;
  71. }
  72. - (void)changeDetailRequestModel:(DetailRequestModel *)model {
  73. self.goods_id = model.goods_id;
  74. self.is_coupon = [NSNumber numberWithInteger:model.is_coupon.integerValue];;
  75. self.coupon_price = model.coupon_price;
  76. self.price = model.price;
  77. self.discount_price = model.discount_price;
  78. self.commission_rate = model.commission_rate;
  79. self.title = model.title;
  80. self.img = model.img;
  81. self.commission_price = model.commission_price;
  82. self.shop_title = model.shop_title;
  83. }
  84. @end