// // LZMShareGoodsModel.m // YouHuiProject // // Created by jcymac on 2018/5/18. // Copyright © 2018年 kuxuan. All rights reserved. // #import "LZMShareGoodsModel.h" @implementation LZMShareGoodsModel -(void)setCommissionPrice:(NSString *)commissionPrice{ float tmp=[commissionPrice floatValue]; _commissionPrice=[NSString stringWithFormat:@"%.2lf",tmp]; } +(LZMShareGoodsModel*)createShareGoodsModelByShareGoodsTempModel:(LZMShareGoodsTempModel *)tempModel{ LZMShareGoodsModel *model=[[LZMShareGoodsModel alloc]init]; //券价格 model.ticketPrice=[NSString stringWithFormat:@"%.2lf",[tempModel.coupon_price floatValue]]; //券后价 model.ticketAfterPrice=[NSString stringWithFormat:@"%.2lf",[tempModel.discount_price floatValue]]; //图片地址 model.mainImageUrl=tempModel.img; //是否有优惠券 if ([tempModel.is_coupon integerValue]==0) { model.shareGoodsPurchaseType=YHShareGoodsPurchaseTypePrice; }else{ model.shareGoodsPurchaseType=YHShareGoodsPurchaseTypeCoupons; } model.originalPrice=[NSString stringWithFormat:@"%.2lf",[tempModel.price floatValue]]; if ([tempModel.shop_type integerValue]==0) { //淘宝 model.shareGoodsFromType=YHShareGoodsFromTypeTaoBao; }else if([tempModel.shop_type integerValue]==1){ //天猫 model.shareGoodsFromType=YHShareGoodsFromTypeTianMao; }else{ //未知 model.shareGoodsFromType=YHShareGoodsFromTypeOriginal; } model.title=tempModel.title; model.infoStr=tempModel.tkl; model.QRcodeImageUrl=tempModel.url; return model; } @end