暫無描述

OrderDetailItem.m 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //
  2. // OrderItem.m
  3. // FirstLink
  4. //
  5. // Created by ascii on 15/6/12.
  6. // Copyright (c) 2015年 FirstLink. All rights reserved.
  7. //
  8. #import "OrderDetailItem.h"
  9. #import "FKSupplierDetailItem.h"
  10. @implementation OrderDetailItem
  11. + (NSDictionary*)mts_mapping {
  12. return @{@"id": mts_key(orderID),
  13. @"is_id_pass": mts_key(isIDPass),
  14. @"note": mts_key(note),
  15. @"derate_fee": mts_key(derateFee),
  16. @"official_postage": mts_key(officialPostage),
  17. @"international_postage": mts_key(internationalPostage),
  18. @"postage": mts_key(postage),
  19. @"tax_fee": mts_key(taxFee),
  20. @"price": mts_key(price),
  21. @"total_fee": mts_key(totalFee),
  22. @"total_price": mts_key(totalPrice),
  23. @"service_fee": mts_key(serviceFee),
  24. @"payment_type": mts_key(paymentType),
  25. @"payment_no": mts_key(paymentNO),
  26. @"payment_time": mts_key(paymentTime),
  27. @"payment_invalid_time": mts_key(paymentInvalidTime),
  28. @"status": mts_key(status),
  29. @"url": mts_key(webURL),
  30. @"create_time": mts_key(createTime),
  31. };
  32. }
  33. + (BOOL)mts_shouldSetUndefinedKeys {
  34. return NO;
  35. }
  36. #pragma mark - Function
  37. - (NSString *)realProductAllPrice {
  38. return [NSString stringWithFormat:@"¥%.2f", self.totalFee.floatValue / 100.0f];
  39. }
  40. - (NSString *)orderCreateTime {
  41. if (self.createTime && self.createTime.length > 0) {
  42. return [self.createTime stringByReplacingOccurrencesOfString:@"T" withString:@" "];
  43. }
  44. return @"";
  45. }
  46. - (NSString *)orderPaymentTime {
  47. if (self.paymentTime && self.paymentTime.length > 0) {
  48. return [self.paymentTime stringByReplacingOccurrencesOfString:@"T" withString:@" "];
  49. }
  50. return nil;
  51. }
  52. @end