Няма описание

FKRefundDetailReform.m 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // FKRefundDetailReform.m
  3. // FirstLink
  4. //
  5. // Created by ascii on 16/3/15.
  6. // Copyright © 2016年 FirstLink. All rights reserved.
  7. //
  8. #import "FKRefundDetailReform.h"
  9. #import "FKRefundDetailItem.h"
  10. #import "FKRefundGoodItem.h"
  11. #import "FKRefundPriceItem.h"
  12. @implementation FKRefundDetailReform
  13. + (NSArray *)parserGoodsList:(NSDictionary *)json {
  14. NSDictionary *dict = json[@"data"][@"list"];
  15. FKRefundDetailItem *detailItem;
  16. FKRefundGoodItem *goodsItem;
  17. FKRefundPriceItem *priceItem;
  18. NSMutableArray *array = [NSMutableArray array];
  19. NSMutableArray *goodsArray;
  20. if ([dict isKindOfClass:[NSArray class]]) {
  21. for (NSDictionary *detailItemDict in dict) {
  22. detailItem = [FKRefundDetailItem new];
  23. [detailItem mts_setValuesForKeysWithDictionary:detailItemDict[@"refund"]];
  24. priceItem = [FKRefundPriceItem new];
  25. [priceItem mts_setValuesForKeysWithDictionary:detailItemDict[@"refund"]];
  26. detailItem.refundPriceItem = priceItem;
  27. goodsArray = [NSMutableArray array];
  28. if ([detailItemDict[@"goods_list"] isKindOfClass:[NSArray class]]){
  29. for (NSDictionary *goodsItemDict in detailItemDict[@"goods_list"]) {
  30. goodsItem = [FKRefundGoodItem new];
  31. [goodsItem mts_setValuesForKeysWithDictionary:goodsItemDict];
  32. [goodsArray addObject:goodsItem];
  33. }
  34. detailItem.goodsArray = goodsArray;
  35. }
  36. [array addObject:detailItem];
  37. }
  38. return array;
  39. }
  40. return nil;
  41. }
  42. @end