1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- //
- // FKRefundDetailReform.m
- // FirstLink
- //
- // Created by ascii on 16/3/15.
- // Copyright © 2016年 FirstLink. All rights reserved.
- //
- #import "FKRefundDetailReform.h"
- #import "FKRefundDetailItem.h"
- #import "FKRefundGoodItem.h"
- #import "FKRefundPriceItem.h"
- @implementation FKRefundDetailReform
- + (NSArray *)parserGoodsList:(NSDictionary *)json {
- NSDictionary *dict = json[@"data"][@"list"];
-
- FKRefundDetailItem *detailItem;
- FKRefundGoodItem *goodsItem;
- FKRefundPriceItem *priceItem;
-
- NSMutableArray *array = [NSMutableArray array];
- NSMutableArray *goodsArray;
- if ([dict isKindOfClass:[NSArray class]]) {
- for (NSDictionary *detailItemDict in dict) {
- detailItem = [FKRefundDetailItem new];
- [detailItem mts_setValuesForKeysWithDictionary:detailItemDict[@"refund"]];
-
- priceItem = [FKRefundPriceItem new];
- [priceItem mts_setValuesForKeysWithDictionary:detailItemDict[@"refund"]];
- detailItem.refundPriceItem = priceItem;
-
- goodsArray = [NSMutableArray array];
- if ([detailItemDict[@"goods_list"] isKindOfClass:[NSArray class]]){
- for (NSDictionary *goodsItemDict in detailItemDict[@"goods_list"]) {
- goodsItem = [FKRefundGoodItem new];
- [goodsItem mts_setValuesForKeysWithDictionary:goodsItemDict];
-
- [goodsArray addObject:goodsItem];
- }
- detailItem.goodsArray = goodsArray;
- }
-
- [array addObject:detailItem];
- }
- return array;
- }
- return nil;
- }
- @end
|