v0.8.0
This commit is contained in:
@@ -45,9 +45,11 @@
|
||||
|
||||
}else if (indexPath.section == 2 && indexPath.row == 3){
|
||||
self.cityLabel.text = @"职业";
|
||||
if (user.occupationCode && ![user.occupationCode isKindOfClass:[NSNull class]] && ![user.occupationCode isEqualToString:@""]) {
|
||||
self.detalTitle.text = user.occupationCode;
|
||||
if (user.occupationName && ![user.occupationName isKindOfClass:[NSNull class]] && ![user.occupationName isEqualToString:@""]) {
|
||||
self.detalTitle.text = user.occupationName;
|
||||
|
||||
}else{
|
||||
|
||||
self.detalTitle.text = @"请从下方标签中选择一项";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,9 +8,10 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
//展开关闭按钮
|
||||
#import "JobModel.h"
|
||||
typedef void (^jobBtnAction)(void);
|
||||
//选中
|
||||
typedef void (^jobSelectAction)(NSString *title);
|
||||
typedef void (^jobSelectAction)(JobModel *model);
|
||||
|
||||
@interface GiGaUserJobViewCell : UITableViewCell
|
||||
@property (nonatomic,strong) UIButton *upDownBtn;
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
#define MAR_GAINX 22.f //左右边距
|
||||
#define MARK_H 31.f //高
|
||||
|
||||
|
||||
@interface GiGaUserJobViewCell()
|
||||
@property (nonatomic,assign) int countY;
|
||||
@property (nonatomic,assign) int countX;
|
||||
@property (nonatomic,strong) NSArray *titles;
|
||||
@property (nonatomic,copy) NSString *selectjob;
|
||||
|
||||
@property (nonatomic) CGFloat btnMaXY;
|
||||
@end
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
_countX = 0;
|
||||
_btnMaXY = 10;
|
||||
[self creatUI];
|
||||
self.titles = [NSArray new];
|
||||
self.jobs = [NSArray new];
|
||||
//self.backgroundColor = [UIColor blueColor];
|
||||
}
|
||||
return self;
|
||||
@@ -69,21 +69,21 @@
|
||||
|
||||
}
|
||||
|
||||
-(void)setButtnImage:(BOOL)isUp with:(NSArray *)titles{
|
||||
self.titles = titles;
|
||||
self.selectjob = @"";
|
||||
-(void)setButtnImage:(BOOL)isUp with:(NSArray *)jobs{
|
||||
self.jobs = jobs;
|
||||
|
||||
if (isUp) {
|
||||
[self setUpUPSubViewstitles:titles isUp:isUp];
|
||||
[self setUpUPSubViewstitles:jobs isUp:isUp];
|
||||
|
||||
}else{
|
||||
[self setUpDownSubviewstitles:titles isUp:isUp];
|
||||
[self setUpDownSubviewstitles:jobs isUp:isUp];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)setUpUPSubViewstitles:(NSArray *)titles isUp:(BOOL)isUp{
|
||||
-(void)setUpUPSubViewstitles:(NSArray *)jobs isUp:(BOOL)isUp{
|
||||
//展开状态
|
||||
[_upDownBtn setBackgroundImage:[UIImage imageNamed:@"userjob_up"] forState:UIControlStateNormal];
|
||||
if (titles.count > 0) {
|
||||
if (jobs.count > 0) {
|
||||
for (JobMaskButton *btn in self.subviews) {
|
||||
|
||||
if ([btn isKindOfClass:[JobMaskButton class]]) {
|
||||
@@ -93,10 +93,11 @@
|
||||
_countX =0;
|
||||
_countY = 0;
|
||||
CGFloat X = MAR_GAINX;
|
||||
for (int i=0; i<titles.count; i ++) {
|
||||
for (int i=0; i<jobs.count; i ++) {
|
||||
|
||||
CGFloat width = 0;
|
||||
NSString *title = titles[i];
|
||||
JobModel *mode = jobs[i];
|
||||
NSString *title = mode.dictLabel;
|
||||
if (title.length == 2) {
|
||||
width = 55;
|
||||
}else if (title.length == 3){
|
||||
@@ -108,7 +109,7 @@
|
||||
width = 55;
|
||||
}
|
||||
|
||||
[self creatjob:titles[i] index:i isUp:isUp orinX:X width:width];
|
||||
[self creatjob:mode index:i isUp:isUp orinX:X width:width];
|
||||
if (_countX == 0) {
|
||||
X = MAR_GAINX;
|
||||
}else{
|
||||
@@ -119,10 +120,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
-(void)setUpDownSubviewstitles:(NSArray *)titles isUp:(BOOL)isUp{
|
||||
-(void)setUpDownSubviewstitles:(NSArray *)jobs isUp:(BOOL)isUp{
|
||||
//收起状态
|
||||
[_upDownBtn setBackgroundImage:[UIImage imageNamed:@"userjob_down"] forState:UIControlStateNormal];
|
||||
if (titles.count > 0) {
|
||||
if (jobs.count > 0) {
|
||||
// [titles enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
// NSString *title = obj;
|
||||
// [self creatjob:title index:idx];
|
||||
@@ -136,10 +137,11 @@
|
||||
_countX =0;
|
||||
_countY = 0;
|
||||
CGFloat X = MAR_GAINX;
|
||||
for (int i=0; i<titles.count; i ++) {
|
||||
for (int i=0; i<jobs.count; i ++) {
|
||||
|
||||
CGFloat width = 0;
|
||||
NSString *title = titles[i];
|
||||
JobModel *mode = jobs[i];
|
||||
NSString *title = mode.dictLabel;
|
||||
if (title.length == 2) {
|
||||
width = 55;
|
||||
}else if (title.length == 3){
|
||||
@@ -151,7 +153,7 @@
|
||||
width = 55;
|
||||
}
|
||||
|
||||
[self creatjob:titles[i] index:i isUp:isUp orinX:X width:width];
|
||||
[self creatjob:mode index:i isUp:isUp orinX:X width:width];
|
||||
|
||||
if (_countX == 0) {
|
||||
X = MAR_GAINX;
|
||||
@@ -163,7 +165,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
-(void)creatjob:(NSString *)title index:(int)idx isUp:(BOOL)isUp orinX:(CGFloat)X width:(CGFloat)width{
|
||||
-(void)creatjob:(JobModel *)job index:(int)idx isUp:(BOOL)isUp orinX:(CGFloat)X width:(CGFloat)width{
|
||||
|
||||
|
||||
CGFloat Y = 10 + (MARK_H + SPACE_Y)*_countY;
|
||||
@@ -193,7 +195,7 @@
|
||||
|
||||
}
|
||||
|
||||
if (idx == self.titles.count - 1) {
|
||||
if (idx == self.jobs.count - 1) {
|
||||
_btnMaXY = Y;
|
||||
[self updateActionBtnFrame];
|
||||
}
|
||||
@@ -206,8 +208,11 @@
|
||||
jobBtn.layer.cornerRadius = MARK_H /2;
|
||||
jobBtn.layer.borderWidth = 1;
|
||||
jobBtn.layer.borderColor = GIGARGB(222, 222, 222, 1).CGColor;
|
||||
jobBtn.jobStr = title;
|
||||
NSAttributedString *attri = [GiGaHelper stringWithText:title textColor:GIGARGB(151, 151, 151, 1) textFont:GIGA_TEXTFONTMEDIUM(13) leterSpace:0];
|
||||
jobBtn.job = job;
|
||||
if (!job.dictLabel) {
|
||||
job.dictLabel = @"??";
|
||||
}
|
||||
NSAttributedString *attri = [GiGaHelper stringWithText:job.dictLabel textColor:GIGARGB(151, 151, 151, 1) textFont:GIGA_TEXTFONTMEDIUM(13) leterSpace:0];
|
||||
[jobBtn setAttributedTitle:attri forState:UIControlStateNormal];
|
||||
jobBtn.frame = CGRectMake(X,Y,width, MARK_H);
|
||||
[jobBtn addTarget:self action:@selector(jobClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||
@@ -226,7 +231,7 @@
|
||||
|
||||
-(void)jobClick:(JobMaskButton *)btn{
|
||||
|
||||
self.jobblock(btn.jobStr);
|
||||
self.jobblock(btn.job);
|
||||
}
|
||||
|
||||
- (void)awakeFromNib {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
-(void)configUserSex:(int)sex{
|
||||
|
||||
if (sex == 0) {
|
||||
if (sex == 2) {
|
||||
[self.usefemale setImage:[UIImage imageNamed:@"sex_selected"] forState:UIControlStateNormal];
|
||||
[self.usermale setImage:[UIImage imageNamed:@"sex_disselect"] forState:UIControlStateNormal];
|
||||
}else{
|
||||
@@ -40,8 +40,8 @@
|
||||
}
|
||||
|
||||
-(void)userfemaleClick{
|
||||
self.actionblock(0);
|
||||
[self configUserSex:0];
|
||||
self.actionblock(2);
|
||||
[self configUserSex:2];
|
||||
}
|
||||
-(void)userSelectSexAction:(femaleBtnAction)block{
|
||||
self.actionblock = block;
|
||||
|
||||
Reference in New Issue
Block a user