两折卖----返利app-----返利圈

LZMShareGoodsModel.m 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // LZMShareGoodsModel.m
  3. // YouHuiProject
  4. //
  5. // Created by jcymac on 2018/5/18.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "LZMShareGoodsModel.h"
  9. @implementation LZMShareGoodsModel
  10. -(void)setCommissionPrice:(NSString *)commissionPrice{
  11. float tmp=[commissionPrice floatValue];
  12. _commissionPrice=[NSString stringWithFormat:@"%.2lf",tmp];
  13. }
  14. +(LZMShareGoodsModel*)createShareGoodsModelByShareGoodsTempModel:(LZMShareGoodsTempModel *)tempModel{
  15. LZMShareGoodsModel *model=[[LZMShareGoodsModel alloc]init];
  16. //券价格
  17. model.ticketPrice=[NSString stringWithFormat:@"%.2lf",[tempModel.coupon_price floatValue]];
  18. //券后价
  19. model.ticketAfterPrice=[NSString stringWithFormat:@"%.2lf",[tempModel.discount_price floatValue]];
  20. //图片地址
  21. model.mainImageUrl=tempModel.img;
  22. //是否有优惠券
  23. if ([tempModel.is_coupon integerValue]==0) {
  24. model.shareGoodsPurchaseType=YHShareGoodsPurchaseTypePrice;
  25. }else{
  26. model.shareGoodsPurchaseType=YHShareGoodsPurchaseTypeCoupons;
  27. }
  28. model.originalPrice=[NSString stringWithFormat:@"%.2lf",[tempModel.price floatValue]];
  29. if ([tempModel.shop_type integerValue]==0) {
  30. //淘宝
  31. model.shareGoodsFromType=YHShareGoodsFromTypeTaoBao;
  32. }else if([tempModel.shop_type integerValue]==1){
  33. //天猫
  34. model.shareGoodsFromType=YHShareGoodsFromTypeTianMao;
  35. }else{
  36. //未知
  37. model.shareGoodsFromType=YHShareGoodsFromTypeOriginal;
  38. }
  39. model.title=tempModel.title;
  40. model.infoStr=tempModel.tkl;
  41. model.QRcodeImageUrl=tempModel.url;
  42. return model;
  43. }
  44. @end