1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- //
- // ShipAddress.m
- // FirstLink
- //
- // Created by ascii on 15/6/11.
- // Copyright (c) 2015年 FirstLink. All rights reserved.
- //
- #import "ShipAddress.h"
- @implementation ShipAddress
- + (NSDictionary*)mts_mapping {
- return @{@"id": mts_key(addressID),
- @"user_id": mts_key(userID),
- @"province": mts_key(province),
- @"city": mts_key(city),
- @"district": mts_key(district),
- @"address": mts_key(address),
- @"zip": mts_key(zip),
- @"is_default": mts_key(isDefault),
- @"receiver": mts_key(receiver),
- @"receiver_phone": mts_key(receiverPhone),
- @"create_time": mts_key(createTime),
- @"update_time": mts_key(updateTime),
- @"is_self_pickup": mts_key(isSelfTake),
- @"id_card_num": mts_key(idCardNum),
- };
- }
- + (BOOL)mts_shouldSetUndefinedKeys {
- return NO;
- }
- - (NSString*)prefixAddress {
- return [NSString stringWithFormat:@"%@%@%@",
- [FLStringHelper replaceNilWithEmpty:self.province],
- [FLStringHelper replaceNilWithEmpty:self.city],
- [FLStringHelper replaceNilWithEmpty:self.district]];
- }
- - (NSString*)detailAddressWithTip {
- return [NSString stringWithFormat:@"收货地址:%@%@",
- self.prefixAddress, self.address];
- }
- - (NSString*)detailAddressWithNoTip {
- return [NSString stringWithFormat:@"%@%@",
- self.prefixAddress, self.address];
- }
- - (BOOL)hasBindedWithIdCard{
- if ([self.idCardNum isKindOfClass:[NSString class]] && self.idCardNum.length > 0) {
- return YES;
- }
- return NO;
- }
- @end
|