// // 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 *)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