No Description

ShipAddress.m 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // ShipAddress.m
  3. // FirstLink
  4. //
  5. // Created by ascii on 15/6/11.
  6. // Copyright (c) 2015年 FirstLink. All rights reserved.
  7. //
  8. #import "ShipAddress.h"
  9. @implementation ShipAddress
  10. + (NSDictionary*)mts_mapping {
  11. return @{@"id": mts_key(addressID),
  12. @"user_id": mts_key(userID),
  13. @"province": mts_key(province),
  14. @"city": mts_key(city),
  15. @"district": mts_key(district),
  16. @"address": mts_key(address),
  17. @"zip": mts_key(zip),
  18. @"is_default": mts_key(isDefault),
  19. @"receiver": mts_key(receiver),
  20. @"receiver_phone": mts_key(receiverPhone),
  21. @"create_time": mts_key(createTime),
  22. @"update_time": mts_key(updateTime),
  23. @"is_self_pickup": mts_key(isSelfTake),
  24. @"id_card_num": mts_key(idCardNum),
  25. };
  26. }
  27. + (BOOL)mts_shouldSetUndefinedKeys {
  28. return NO;
  29. }
  30. - (NSString*)prefixAddress {
  31. return [NSString stringWithFormat:@"%@%@%@",
  32. [FLStringHelper replaceNilWithEmpty:self.province],
  33. [FLStringHelper replaceNilWithEmpty:self.city],
  34. [FLStringHelper replaceNilWithEmpty:self.district]];
  35. }
  36. - (NSString*)detailAddressWithTip {
  37. return [NSString stringWithFormat:@"收货地址:%@%@",
  38. self.prefixAddress, self.address];
  39. }
  40. - (NSString*)detailAddressWithNoTip {
  41. return [NSString stringWithFormat:@"%@%@",
  42. self.prefixAddress, self.address];
  43. }
  44. - (BOOL)hasBindedWithIdCard{
  45. if ([self.idCardNum isKindOfClass:[NSString class]] && self.idCardNum.length > 0) {
  46. return YES;
  47. }
  48. return NO;
  49. }
  50. @end