fix 个人信息

This commit is contained in:
lianxiang
2018-09-16 13:42:55 +08:00
parent 9bba78987b
commit 718900a428
62 changed files with 17474 additions and 29 deletions
@@ -9,5 +9,8 @@
#import <UIKit/UIKit.h>
@interface GIGaUserCityViewCell : UITableViewCell
-(void)loadCellData:(NSIndexPath*)indexPath user:(GiGaUser*)user;
@property (weak, nonatomic) IBOutlet UILabel *cityLabel;
@property (weak, nonatomic) IBOutlet UILabel *detalTitle;
@end
@@ -15,6 +15,33 @@
// Initialization code
}
-(void)loadCellData:(NSIndexPath*)indexPath user:(GiGaUser*)user{
if (indexPath.section == 2 && indexPath.row == 1) {
self.cityLabel.text = @"生日";
if (user.birthday && ![user.birthday isKindOfClass:[NSNull class]]) {
self.detalTitle.text = user.birthday;
}else{
self.detalTitle.text = @"选择生日";
}
}else if (indexPath.section == 2 && indexPath.row == 2){
self.cityLabel.text = @"城市";
if (user.cityName && ![user.cityName isKindOfClass:[NSNull class]]) {
self.detalTitle.text = user.cityName;
}else{
self.detalTitle.text = @"选择城市";
}
}else if (indexPath.section == 2 && indexPath.row == 3){
self.cityLabel.text = @"职业";
if (user.occupationCode && ![user.occupationCode isKindOfClass:[NSNull class]]) {
self.detalTitle.text = user.occupationCode;
}else{
self.detalTitle.text = @"选择职业";
}
}
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
@@ -59,7 +59,11 @@
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<point key="canvasLocation" x="33.5" y="68"/>
<connections>
<outlet property="cityLabel" destination="OA0-rJ-5qY" id="sFb-nt-6vY"/>
<outlet property="detalTitle" destination="y6H-zg-4yv" id="Yhl-Hx-EGv"/>
</connections>
<point key="canvasLocation" x="-41" y="69"/>
</tableViewCell>
</objects>
<resources>
@@ -9,5 +9,8 @@
#import <UIKit/UIKit.h>
@interface GIGaUserIDViewCell : UITableViewCell
-(void)loadCellData:(NSIndexPath*)indexPath user:(GiGaUser*)user;
@property (weak, nonatomic) IBOutlet UILabel *IdLabel;
@property (weak, nonatomic) IBOutlet UILabel *userTitle;
@end
@@ -14,7 +14,22 @@
[super awakeFromNib];
// Initialization code
}
- (void)loadCellData:(NSIndexPath *)indexPath user:(GiGaUser*)user{
if (indexPath.section == 1 && indexPath.row == 0 ) {
self.IdLabel.text = user.userId;
self.userTitle.text = @"用户ID";
}else if (indexPath.section == 1 && indexPath.row == 1){
self.userTitle.text = @"昵称";
if (user.nickName && ![user.nickName isKindOfClass:[NSNull class]]) {
self.IdLabel.text = user.nickName;
}else{
self.IdLabel.text = @"昵称";
}
}
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
@@ -50,6 +50,10 @@
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<connections>
<outlet property="IdLabel" destination="4Oa-fe-SvG" id="zho-2s-rPC"/>
<outlet property="userTitle" destination="HzQ-bQ-e0n" id="kPd-kc-XZU"/>
</connections>
<point key="canvasLocation" x="33.5" y="68"/>
</tableViewCell>
</objects>
@@ -9,5 +9,6 @@
#import <UIKit/UIKit.h>
@interface GIGaUserInfoAvatorCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIImageView *userAvator;
-(void)loadCellData:(NSIndexPath*)indexPath user:(GiGaUser*)user;
@end
@@ -7,12 +7,22 @@
//
#import "GIGaUserInfoAvatorCell.h"
#import "UIImageView+WebCache.h"
@implementation GIGaUserInfoAvatorCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
self.userAvator.layer.masksToBounds = YES;
self.userAvator.layer.cornerRadius = self.userAvator.frame.size.height /2 ;
}
- (void)loadCellData:(NSIndexPath *)indexPath user:(GiGaUser *)user{
if (user.headImgUrl && ![user.headImgUrl isKindOfClass:[NSNull class]]) {
[self.userAvator sd_setImageWithURL:[NSURL URLWithString:user.headImgUrl]];
}
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
@@ -26,7 +26,7 @@
<constraint firstAttribute="height" constant="82" id="ipN-ci-Ha3"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" 用户名" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bZT-xd-Nax">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" 点击修改头像" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bZT-xd-Nax">
<rect key="frame" x="16" y="106" width="343" height="16"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="11"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
@@ -43,6 +43,9 @@
</tableViewCellContentView>
<color key="backgroundColor" red="0.51372549020000002" green="0.039215686270000001" blue="0.039215686270000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<connections>
<outlet property="userAvator" destination="L0Q-5Y-jXq" id="IIT-bz-CcZ"/>
</connections>
<point key="canvasLocation" x="9.5" y="62.5"/>
</tableViewCell>
</objects>
@@ -10,5 +10,5 @@
@interface GIGaUserWeChatViewCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UITextField *weiXinCount;
-(void)loadCellData:(NSIndexPath*)indexPath user:(GiGaUser*)user;
@end
@@ -15,7 +15,13 @@
// Initialization code
}
-(void)loadCellData:(NSIndexPath*)indexPath user:(GiGaUser*)user{
if (user.weixin && ![user.weixin isKindOfClass:[NSNull class]]) {
self.weiXinCount.text = user.weixin;
}
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
@@ -8,8 +8,14 @@
#import <UIKit/UIKit.h>
typedef void (^femaleBtnAction)(int sex);
@interface GiGaUserSexViewCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIButton *usefemale;
@property (weak, nonatomic) IBOutlet UIButton *usermale;
-(void)loadCellData:(NSIndexPath*)indexPath user:(GiGaUser*)user;
-(void)userSelectSexAction:(femaleBtnAction)block;
@property (nonatomic,copy) femaleBtnAction actionblock;
-(void)configUserSex:(int)sex;
@end
@@ -13,8 +13,39 @@
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
[self.usermale addTarget:self action:@selector(usermaleClick) forControlEvents:UIControlEventTouchUpInside];
[self.usefemale addTarget:self action:@selector(userfemaleClick) forControlEvents:UIControlEventTouchUpInside];
}
-(void)loadCellData:(NSIndexPath*)indexPath user:(GiGaUser*)user{
int sex = user.sexCode;
[self configUserSex:sex];
}
-(void)configUserSex:(int)sex{
if (sex == 0) {
[self.usefemale setImage:[UIImage imageNamed:@"sex_selected"] forState:UIControlStateNormal];
[self.usermale setImage:[UIImage imageNamed:@"sex_disselect"] forState:UIControlStateNormal];
}else{
[self.usermale setImage:[UIImage imageNamed:@"sex_selected"] forState:UIControlStateNormal];
[self.usefemale setImage:[UIImage imageNamed:@"sex_disselect"] forState:UIControlStateNormal];
}
}
-(void)usermaleClick{
self.actionblock(1);
[self configUserSex:1];
}
-(void)userfemaleClick{
self.actionblock(0);
[self configUserSex:0];
}
-(void)userSelectSexAction:(femaleBtnAction)block{
self.actionblock = block;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];