This commit is contained in:
lianxiang
2018-09-29 20:12:56 +08:00
parent cb0accdb66
commit fc47921130
99 changed files with 1635 additions and 563 deletions
@@ -30,7 +30,7 @@
}
if ( textView.text.length <=100 ) {
self.holdLabe.hidden = YES;
self.numberCountLabe.text = [NSString stringWithFormat:@"%lu/100",(unsigned long)textView.text.length];
self.contentFiled.text = textView.text;
self.textMAx = textView.text;
@@ -6,7 +6,6 @@
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@@ -14,10 +13,10 @@
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="MasHistoryFirstViewCell" rowHeight="170" id="KGk-i7-Jjw" customClass="MasHistoryFirstViewCell">
<rect key="frame" x="0.0" y="0.0" width="320" height="170"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="170"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="320" height="169.5"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="169.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="f8a-yz-Ecb">
@@ -30,54 +29,18 @@
<inset key="titleEdgeInsets" minX="-80" minY="0.0" maxX="0.0" maxY="0.0"/>
<state key="normal" title="清零小规则" image="history_rule"/>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kdE-Q9-u1i">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="* 请在一周内再次使用面膜" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kdE-Q9-u1i">
<rect key="frame" x="22" y="42" width="57" height="26"/>
<constraints>
<constraint firstAttribute="width" constant="57" id="HVg-ED-OKU"/>
<constraint firstAttribute="height" constant="26" id="n41-cc-XrC"/>
</constraints>
<string key="text">* 请在80小时内
再次使用面膜</string>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="8"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="XgR-jp-VUJ">
<rect key="frame" x="109" y="11" width="100" height="100"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="共敷" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="7" translatesAutoresizingMaskIntoConstraints="NO" id="yat-Uk-2j1">
<rect key="frame" x="32" y="12" width="37" height="25.5"/>
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="18"/>
<color key="textColor" red="1" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="min" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aJM-2t-hFP">
<rect key="frame" x="38.5" y="64" width="24.5" height="20"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="14"/>
<color key="textColor" red="1" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="180" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fqH-WX-zEA">
<rect key="frame" x="22" y="25" width="58" height="50.5"/>
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="36"/>
<color key="textColor" red="1" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="yat-Uk-2j1" firstAttribute="top" secondItem="XgR-jp-VUJ" secondAttribute="top" constant="12" id="3xZ-MZ-f3I"/>
<constraint firstItem="aJM-2t-hFP" firstAttribute="centerX" secondItem="XgR-jp-VUJ" secondAttribute="centerX" id="P2i-aA-ZJF"/>
<constraint firstItem="fqH-WX-zEA" firstAttribute="centerX" secondItem="XgR-jp-VUJ" secondAttribute="centerX" constant="1" id="dhW-15-2LC"/>
<constraint firstAttribute="width" secondItem="XgR-jp-VUJ" secondAttribute="height" multiplier="1:1" id="fVj-dY-YeA"/>
<constraint firstAttribute="bottom" secondItem="aJM-2t-hFP" secondAttribute="bottom" constant="16" id="pvb-40-kKm"/>
<constraint firstItem="yat-Uk-2j1" firstAttribute="centerX" secondItem="XgR-jp-VUJ" secondAttribute="centerX" constant="0.5" id="t5T-IV-EBK"/>
<constraint firstItem="fqH-WX-zEA" firstAttribute="centerY" secondItem="XgR-jp-VUJ" secondAttribute="centerY" id="vdQ-y0-8o5"/>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="88" id="zgI-yU-SUl"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="本月超过80%的用户" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gnX-9k-8vZ">
<rect key="frame" x="175" y="139" width="129" height="20"/>
<rect key="frame" x="230" y="139" width="129" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="Q4p-6w-N8a"/>
</constraints>
@@ -85,18 +48,61 @@
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="XgR-jp-VUJ">
<rect key="frame" x="128" y="11" width="119" height="118"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="共敷" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="7" translatesAutoresizingMaskIntoConstraints="NO" id="yat-Uk-2j1">
<rect key="frame" x="41" y="16" width="37" height="25.5"/>
<constraints>
<constraint firstAttribute="width" constant="37" id="3yU-pS-4Pb"/>
<constraint firstAttribute="height" constant="25.5" id="EC2-3e-Xae"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="18"/>
<color key="textColor" red="1" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="180" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fqH-WX-zEA">
<rect key="frame" x="30" y="40" width="58" height="50.5"/>
<constraints>
<constraint firstAttribute="height" constant="50.5" id="85h-EW-hg3"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="36"/>
<color key="textColor" red="1" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="min" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aJM-2t-hFP">
<rect key="frame" x="47" y="90" width="24.5" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="5Oe-im-gkA"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="14"/>
<color key="textColor" red="1" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="fqH-WX-zEA" firstAttribute="centerX" secondItem="XgR-jp-VUJ" secondAttribute="centerX" id="Huy-BG-lGv"/>
<constraint firstItem="aJM-2t-hFP" firstAttribute="centerX" secondItem="XgR-jp-VUJ" secondAttribute="centerX" id="RgZ-CQ-Lhm"/>
<constraint firstItem="aJM-2t-hFP" firstAttribute="top" secondItem="fqH-WX-zEA" secondAttribute="bottom" constant="-0.5" id="WBv-2U-0cS"/>
<constraint firstItem="yat-Uk-2j1" firstAttribute="top" secondItem="XgR-jp-VUJ" secondAttribute="top" constant="16" id="WZC-sR-cPc"/>
<constraint firstAttribute="width" constant="119" id="WsA-J0-Gli"/>
<constraint firstItem="yat-Uk-2j1" firstAttribute="centerX" secondItem="XgR-jp-VUJ" secondAttribute="centerX" id="aLv-jU-RHg"/>
<constraint firstAttribute="height" constant="118" id="aOY-R6-46q"/>
<constraint firstItem="fqH-WX-zEA" firstAttribute="top" secondItem="yat-Uk-2j1" secondAttribute="bottom" constant="-1.5" id="eot-uQ-07L"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" red="1" green="0.70196078431372544" blue="0.70196078431372544" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="kdE-Q9-u1i" firstAttribute="top" secondItem="f8a-yz-Ecb" secondAttribute="bottom" constant="-6" id="33L-Pm-zjw"/>
<constraint firstItem="XgR-jp-VUJ" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="11" id="F2r-eg-vAz"/>
<constraint firstAttribute="trailing" secondItem="XgR-jp-VUJ" secondAttribute="trailing" constant="111" id="UwV-Lm-aak"/>
<constraint firstItem="XgR-jp-VUJ" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="11" id="3HH-sH-rJP"/>
<constraint firstItem="gnX-9k-8vZ" firstAttribute="top" secondItem="XgR-jp-VUJ" secondAttribute="bottom" constant="10" id="992-53-WQM"/>
<constraint firstItem="XgR-jp-VUJ" firstAttribute="centerX" secondItem="H2p-sc-9uM" secondAttribute="centerX" id="JUF-mj-xVh"/>
<constraint firstItem="f8a-yz-Ecb" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="VMM-iR-qKh"/>
<constraint firstAttribute="trailing" secondItem="gnX-9k-8vZ" secondAttribute="trailing" constant="16" id="aUb-zx-Io4"/>
<constraint firstItem="f8a-yz-Ecb" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="3" id="fed-Wy-3U8"/>
<constraint firstItem="gnX-9k-8vZ" firstAttribute="top" secondItem="XgR-jp-VUJ" secondAttribute="bottom" constant="28" id="hQc-U7-TzD"/>
<constraint firstAttribute="bottom" secondItem="gnX-9k-8vZ" secondAttribute="bottom" constant="10.5" id="heD-OR-neY"/>
<constraint firstItem="XgR-jp-VUJ" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="109" id="mKf-YY-Itt"/>
<constraint firstItem="kdE-Q9-u1i" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="22" id="ts5-1h-1Td"/>
</constraints>
</tableViewCellContentView>
@@ -13,7 +13,7 @@
@property (weak, nonatomic) IBOutlet UIButton *skinBtn;
@property (weak, nonatomic) IBOutlet UIButton *timeBtn;
@property (weak, nonatomic) IBOutlet UILabel *timeLabe;
@property (weak, nonatomic) IBOutlet UILabel *timesLabe;
-(void)loadCellDataAt:(NSIndexPath *)indepath recod:(MaskHistryRecord*)model;
@end
@@ -23,16 +23,17 @@
-(void)loadCellDataAt:(NSIndexPath *)indepath recod:(MaskHistryRecord*)model
{
self.timesLabe.text = [NSString stringWithFormat:@"第%@天敷面膜",model.dayNum];
self.timeLabe.text = model.createTime;
if (![model.skinTypeName isKindOfClass:[NSNull class]] && model.skinTypeName) {
NSAttributedString *atrtskin = [GiGaHelper stringWithText:model.skinTypeName textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTMEDIUM(10) leterSpace:0];
if (![model.dayNum isKindOfClass:[NSNull class]] && model.dayNum) {
NSString *str = [NSString stringWithFormat:@"%@天",model.dayNum];
NSAttributedString *atrtskin = [GiGaHelper stringWithText:str textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTMEDIUM(10) leterSpace:0];
[self.skinBtn setAttributedTitle:atrtskin forState:UIControlStateNormal];
}
if (![model.minute isKindOfClass:[NSNull class]] && model.minute) {
NSAttributedString *atrtskin = [GiGaHelper stringWithText:[NSString stringWithFormat:@"倒计时%@分钟",model.minute] textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTMEDIUM(10) leterSpace:0];
NSAttributedString *atrtskin = [GiGaHelper stringWithText:[NSString stringWithFormat:@"%@分钟",model.minute] textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTMEDIUM(10) leterSpace:0];
[self.timeBtn setAttributedTitle:atrtskin forState:UIControlStateNormal];
}
@@ -39,10 +39,12 @@
<inset key="imageEdgeInsets" minX="-31" minY="0.0" maxX="0.0" maxY="0.0"/>
<state key="normal" title="2天" image="user_day"/>
</button>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="yqe-qC-fXL">
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="yqe-qC-fXL">
<rect key="frame" x="0.0" y="89" width="320" height="1"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.92156862745098034" green="0.92156862745098034" blue="0.92156862745098034" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="aWv-dI-zfh"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xUV-cj-Gt5">
<rect key="frame" x="128" y="22" width="80" height="22"/>
@@ -58,9 +60,12 @@
</subviews>
<constraints>
<constraint firstItem="xUV-cj-Gt5" firstAttribute="leading" secondItem="TIW-fP-uXf" secondAttribute="trailing" constant="32" id="FLX-8w-r6S"/>
<constraint firstAttribute="bottom" secondItem="yqe-qC-fXL" secondAttribute="bottom" id="H0P-mF-de9"/>
<constraint firstItem="yqe-qC-fXL" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="Ift-bs-oY0"/>
<constraint firstItem="2o1-kY-jHA" firstAttribute="top" secondItem="TIW-fP-uXf" secondAttribute="bottom" constant="21" id="Lix-N2-E7N"/>
<constraint firstItem="TIW-fP-uXf" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="22" id="OK4-lu-IY7"/>
<constraint firstItem="xUV-cj-Gt5" firstAttribute="centerY" secondItem="TIW-fP-uXf" secondAttribute="centerY" id="U8G-ca-TRT"/>
<constraint firstAttribute="trailing" secondItem="yqe-qC-fXL" secondAttribute="trailing" id="ZZF-vh-ZnH"/>
<constraint firstItem="2o1-kY-jHA" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="gw8-ZC-PCe"/>
<constraint firstAttribute="bottom" secondItem="2o1-kY-jHA" secondAttribute="bottom" constant="10.5" id="rmO-12-pDZ"/>
<constraint firstItem="TIW-fP-uXf" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="ze4-YE-CYw"/>
+3 -1
View File
@@ -7,7 +7,9 @@
//
#import <UIKit/UIKit.h>
#import "JobModel.h"
@interface JobMaskButton : UIButton
@property (nonatomic,copy) NSString *jobStr;
@property (nonatomic,strong) JobModel *job;
@end
@@ -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;