123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- //
- // DRGoodDetailModel.m
- // YouHuiProject
- //
- // Created by xiaoxi on 2018/1/24.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "DRGoodDetailModel.h"
- #import "DRDetailImgModel.h"
- #import "DRCommunityDetailModel.h"
- @implementation DRGoodDetailModel
- + (NSDictionary<NSString *,id> *)modelCustomPropertyMapper {
- return @{@"Id":@"id"};
- }
- + (NSDictionary *)modelContainerPropertyGenericClass {
- return @{@"detail_pic":[DRDetailImgModel class]};
- }
- //+ (NSDictionary *)modelContainerPropertyGenericClass {
- // return @{@"shop":[DRShopModel class]};
- //}
- -(void)setCommission_price:(NSString *)commission_price{
- if ([@"" isEqualToString:commission_price]) {
- _commission_price=@"";
- }else{
- float tmp=[commission_price floatValue];
- _commission_price=[NSString stringWithFormat:@"%.2lf",tmp];
- }
-
- }
- /**
- model转换
- */
- - (void)changeDetailModelWithComunityRightModel:(DRCommunityRightModel *)model {
- /*
- @"goods_id":self.goodModel.goods_id,
- @"is_coupon":self.goodModel.is_coupon,
- @"coupon_price":self.goodModel.coupon_price,
- @"price":self.goodModel.price,
- @"discount_price":self.goodModel.discount_price,
- @"commission_rate":self.goodModel.commission_rate,
- @"coupon_end_time":coupon_end_time,
- @"coupon_start_time":coupon_start_time
- **/
- self.goods_id = model.goods_id;
- self.is_coupon = [NSNumber numberWithInteger:model.is_coupon.integerValue];
- self.coupon_price = model.coupon_price;
- self.price = model.price;
- self.discount_price = model.discount_price;
- self.commission_rate = model.commission_rate;
- self.start_time = model.start_time;
- self.end_time = model.end_time;
- }
- - (void)changeDetailModelWithComunityModel:(DRCommunityDetailModel *)model {
- /*
- @"goods_id":self.goodModel.goods_id,
- @"is_coupon":self.goodModel.is_coupon,
- @"coupon_price":self.goodModel.coupon_price,
- @"price":self.goodModel.price,
- @"discount_price":self.goodModel.discount_price,
- @"commission_rate":self.goodModel.commission_rate,
- @"coupon_end_time":coupon_end_time,
- @"coupon_start_time":coupon_start_time
- **/
- self.goods_id = model.goods_id;
- self.is_coupon = [NSNumber numberWithInteger:model.is_coupon.integerValue];
- self.coupon_price = model.coupon_price;
- self.price = model.price;
- self.discount_price = model.discount_price;
- self.commission_rate = model.commission_rate;
- // self.start_time = model.start_time;
- // self.end_time = model.end_time;
- }
- - (void)changeDetailRequestModel:(DetailRequestModel *)model {
- self.goods_id = model.goods_id;
- self.is_coupon = [NSNumber numberWithInteger:model.is_coupon.integerValue];;
- self.coupon_price = model.coupon_price;
- self.price = model.price;
- self.discount_price = model.discount_price;
- self.commission_rate = model.commission_rate;
- self.title = model.title;
- self.img = model.img;
- self.commission_price = model.commission_price;
- self.shop_title = model.shop_title;
- }
- @end
|