// // YMPersonalPageInfoCellViewModel.m // MSYOUPAI // // Created by YoMi on 2024/2/18. // Copyright © 2024 MS. All rights reserved. // #import "YMPersonalPageInfoCellViewModel.h" #import "YMPersonalInfoModel.h" @interface YMPersonalPageInfoCellViewModel () /// 信息标题 @property (nonatomic, copy, readwrite) NSString *infoTitle; /// 信息内容 @property (nonatomic, copy, readwrite) NSString *infoContent; @end @implementation YMPersonalPageInfoCellViewModel - (void)ym_initialize{ [super ym_initialize]; if ([self.params[ParamsModel] isKindOfClass:[YMBasicInfoModel class]]) { YMBasicInfoModel *model = self.params[ParamsModel]; self.infoTitle = stringFormat(@"%@:",model.title); if (OCStringIsEmpty(model.value) || [model.value isEqualToString:@"0"]) { self.infoContent = @"保密"; } else { if ([model.key isEqualToString:@"signs"]) { NSArray * constellationDataArray = @[ @"保密", @"白羊座", @"金牛座", @"双子座", @"巨蟹座", @"狮子座", @"处女座", @"天秤座", @"天蝎座", @"射手座", @"摩羯座", @"水瓶座", @"双鱼座", ]; self.infoContent = constellationDataArray[[model.value intValue] > 12 ? 0 : [model.value intValue]]; }else if ([model.key isEqualToString:@"gender"]) { self.infoContent = [model.value isEqualToString:@"1"] ? @"女" : @"男"; } else { self.infoContent = model.value; } } } } @end