123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- //
- // YZMAShareGoodsModel.m
- // YouHuiProject
- //
- // Created by jcymac on 2018/5/18.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "YZMAShareGoodsModel.h"
- @implementation YZMAShareGoodsModel
- -(void)setCommissionPrice:(NSString *)commissionPrice{
- float tmp=[commissionPrice floatValue];
- _commissionPrice=[NSString stringWithFormat:@"%.2lf",tmp];
- }
- +(YZMAShareGoodsModel*)createShareGoodsModelByShareGoodsTempModel:(YZMAShareGoodsTempModel *)tempModel{
- YZMAShareGoodsModel *model=[[YZMAShareGoodsModel 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
|