v0.8.0
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
@@ -38,11 +38,11 @@
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ns1-dj-ePW">
|
||||
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ns1-dj-ePW">
|
||||
<rect key="frame" x="68.5" y="289" width="238" height="88"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="客服热线: 400-0000-000" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fQZ-vC-DAg">
|
||||
<rect key="frame" x="44" y="25" width="151" height="17"/>
|
||||
<rect key="frame" x="43.5" y="25" width="151" height="17"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="12"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
|
||||
@@ -25,16 +25,27 @@
|
||||
@property(nonatomic,copy) NSString *xinCode;
|
||||
@property(nonatomic,strong) NSTimer*timer;
|
||||
@property(nonatomic) NSInteger time;
|
||||
@property(nonatomic,strong) UIButton *codeBtn;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation GiGaChangePhoneNumberVC
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
if (self.timer) {
|
||||
[self.timer invalidate];
|
||||
self.timer = nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self addNavTitile:@"修改手机号"];
|
||||
_nextSteep = NO;
|
||||
_time = 60;
|
||||
|
||||
|
||||
// Do any additional setup after loading the view from its nib.
|
||||
[self.view addSubview:self.tableView];
|
||||
self.tableView.delegate = self;
|
||||
@@ -66,13 +77,23 @@
|
||||
cell = [[[NSBundle mainBundle] loadNibNamed:@"GIGaUserChangeMobleCell" owner:self options:nil] lastObject];
|
||||
|
||||
}
|
||||
|
||||
[cell.codeSendBtn addTarget:self action:@selector(sendCodeBtnAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
self.codeBtn = cell.codeSendBtn;
|
||||
|
||||
|
||||
if (_nextSteep) {
|
||||
cell.numberTexFiled.userInteractionEnabled = YES;
|
||||
cell.numberTexFiled.text = @"";
|
||||
cell.numberTexFiled.placeholder = @"请输入新手机号";
|
||||
cell.codeTexFiled.text = @"";
|
||||
cell.codeTexFiled.placeholder = @"请输入新手机验证码";
|
||||
|
||||
|
||||
cell.oldBtn.backgroundColor = GIGARGB(227, 227, 227, 1);
|
||||
NSAttributedString *att = [GiGaHelper stringWithText:@"发送验证码" textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTBOLD(10) leterSpace:0];
|
||||
[cell.codeSendBtn setAttributedTitle:att forState:UIControlStateNormal];
|
||||
cell.codeSendBtn.backgroundColor = GIGARGB(181, 14, 14, 1);
|
||||
cell.codeSendBtn.userInteractionEnabled = YES;
|
||||
|
||||
NSAttributedString *atti1 = [GiGaHelper stringWithText:@"1.验证原号码" textColor:GIGARGB(165,165, 165, 1) textFont:GIGA_TEXTFONTMEDIUM(13) leterSpace:0];
|
||||
[cell.oldBtn setAttributedTitle:atti1 forState:UIControlStateNormal];
|
||||
@@ -122,10 +143,10 @@
|
||||
[nextBtn addTarget:self action:@selector(nextBtnAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
nextBtn.frame = CGRectMake((KMainW - 244)/2 , 5, 244, 41);
|
||||
if (_nextSteep) {
|
||||
NSAttributedString *attrititle = [GiGaHelper stringWithText:@"下一步" textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTBOLD(16) leterSpace:0];
|
||||
NSAttributedString *attrititle = [GiGaHelper stringWithText:@"完成" textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTBOLD(16) leterSpace:0];
|
||||
[nextBtn setAttributedTitle:attrititle forState:UIControlStateNormal];
|
||||
}else{
|
||||
NSAttributedString *attrititle = [GiGaHelper stringWithText:@"完成" textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTBOLD(16) leterSpace:0];
|
||||
NSAttributedString *attrititle = [GiGaHelper stringWithText:@"下一步" textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTBOLD(16) leterSpace:0];
|
||||
[nextBtn setAttributedTitle:attrititle forState:UIControlStateNormal];
|
||||
}
|
||||
|
||||
@@ -160,7 +181,7 @@
|
||||
#pragma mark 下一步 Or 完成
|
||||
-(void)nextBtnAction:(UIButton *)btn{
|
||||
|
||||
|
||||
|
||||
if (_nextSteep) {
|
||||
GILog(@"完成");
|
||||
|
||||
@@ -180,8 +201,7 @@
|
||||
}
|
||||
|
||||
[self verifyPhoneCode:cell.numberTexFiled.text code:cell.codeTexFiled.text btn:btn];
|
||||
|
||||
|
||||
|
||||
}else{
|
||||
GILog(@"下一步");
|
||||
|
||||
@@ -195,6 +215,7 @@
|
||||
GiGaUser *user = [[GiGaUserManager shareUser] getCurrentUser];
|
||||
if (!user.mobile || [user.mobile isKindOfClass:[NSNull class]]) {
|
||||
GILog(@"手机号为空");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -207,8 +228,10 @@
|
||||
|
||||
GiGaUser *user = [[GiGaUserManager shareUser] getCurrentUser];
|
||||
NSString *oldphone = user.mobile;
|
||||
GIGaUserChangeMobleCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0
|
||||
inSection:0]];
|
||||
|
||||
GiGaBaseAPiRequest *api = [GiGaBaseAPiRequest initWithRequestPath: kApiChangePhone method:RequestPostMethod parms:@{@"oldMobile":oldphone,@"newMobile":xinNumber,@"oldVerifiedCode":self.oldCode,@"newVerifiedCode":self.xinCode}];
|
||||
GiGaBaseAPiRequest *api = [GiGaBaseAPiRequest initWithRequestPath: kApiChangePhone method:RequestPostMethod parms:@{@"oldMobile":oldphone,@"newMobile":xinNumber,@"oldVerifiedCode":self.oldCode,@"newVerifiedCode":cell.codeTexFiled.text}];
|
||||
[api requstDataWithResult:^(GiGaAPIResult *result) {
|
||||
btn.userInteractionEnabled = YES;
|
||||
[self.view hideToastActivity];
|
||||
@@ -226,18 +249,22 @@
|
||||
-(void)sendCodeBtnAction:(UIButton *)btn{
|
||||
|
||||
|
||||
|
||||
if (_nextSteep) {
|
||||
GIGaUserChangeMobleCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
|
||||
if (cell.numberTexFiled.text.length == 0) {
|
||||
GIGA_ShowToast(@"请输新手机号");
|
||||
return;
|
||||
}
|
||||
if (![GiGaHelper isPhoneNumber:cell.numberTexFiled.text]) {
|
||||
GIGA_ShowToast(@"请输入正确手机号");
|
||||
return;
|
||||
}
|
||||
|
||||
btn.userInteractionEnabled = NO;
|
||||
[self startTimer:btn];
|
||||
self.time = 60;
|
||||
self.xinCode = cell.codeTexFiled.text;
|
||||
[self sendCodeWith:cell.numberTexFiled.text];
|
||||
//发送新手机验证码
|
||||
[self sendCodeWith:cell.numberTexFiled.text
|
||||
codebtn:btn];
|
||||
|
||||
}else{
|
||||
|
||||
@@ -247,45 +274,72 @@
|
||||
return;
|
||||
}
|
||||
|
||||
btn.userInteractionEnabled = NO;
|
||||
[self startTimer:btn];
|
||||
[self sendCodeWith:user.mobile];
|
||||
//发送旧手机验证码
|
||||
[self sendCodeWith:user.mobile codebtn:btn];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//计时
|
||||
-(void)startTimer:(UIButton *)btn{
|
||||
-(void)startTimer{
|
||||
[self cancleTimerCount];
|
||||
self.timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(startTimercount) userInfo:nil repeats:YES];
|
||||
[[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSDefaultRunLoopMode];
|
||||
|
||||
}
|
||||
|
||||
-(void)startTimercount{
|
||||
|
||||
GIGaUserChangeMobleCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0
|
||||
inSection:0]];
|
||||
cell.codeSendBtn.backgroundColor = [UIColor lightGrayColor];
|
||||
cell.codeSendBtn.userInteractionEnabled = NO;
|
||||
__weak typeof(cell) weakCell = cell;
|
||||
if (_time>0) {
|
||||
_timer = [NSTimer scheduledTimerWithTimeInterval:1 count:60 callback:^{
|
||||
NSString *timeStr=[NSString stringWithFormat:@"%lds",(long)self->_time];
|
||||
[btn setTitle:timeStr forState:UIControlStateNormal];
|
||||
self->_time--;
|
||||
weakify(self);
|
||||
weakSelf.time -- ;
|
||||
|
||||
NSString *timeStr=[NSString stringWithFormat:@"%lds",(long)weakSelf.time];
|
||||
NSAttributedString *att = [GiGaHelper stringWithText:timeStr textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTBOLD(10) leterSpace:0];
|
||||
[weakCell.codeSendBtn setAttributedTitle:att forState:UIControlStateNormal];
|
||||
|
||||
if (weakSelf.time==0) {
|
||||
|
||||
if (self->_time==0) {
|
||||
[self codeBtnStateNormal];
|
||||
}
|
||||
[weakSelf codeBtnStateNormal];
|
||||
weakCell.codeSendBtn.userInteractionEnabled = YES;
|
||||
weakCell.codeSendBtn.backgroundColor = GIGARGB(181, 14, 14, 1);
|
||||
[self cancleTimerCount];
|
||||
|
||||
}];
|
||||
[[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-(void)sendCodeWith:(NSString *)phone{
|
||||
-(void)cancleTimerCount{
|
||||
|
||||
if (self.timer) {
|
||||
[self.timer invalidate];
|
||||
self.timer = nil;
|
||||
}
|
||||
}
|
||||
|
||||
-(void)sendCodeWith:(NSString *)phone codebtn:(UIButton *)btn{
|
||||
NSString *utl = nil;
|
||||
if (_nextSteep) {
|
||||
utl= kApiChangeMobleCode;
|
||||
utl= kApiChangeMobleNewCode;
|
||||
}else{
|
||||
utl= kApiSendPhoneCode;
|
||||
utl= kApiChangeMobleOldCode;
|
||||
}
|
||||
|
||||
GiGaBaseAPiRequest *api = [GiGaBaseAPiRequest initWithRequestPath:utl method:RequestPostMethod parms:@{@"mobile":phone}];
|
||||
[api requstDataWithResult:^(GiGaAPIResult *result) {
|
||||
|
||||
if (result.success) {
|
||||
|
||||
[self startTimer];
|
||||
GIGA_ShowToast(@"已发送");
|
||||
}else{
|
||||
[self codeBtnStateNormal];
|
||||
|
||||
GIGA_ShowToast(result.message);
|
||||
}
|
||||
}];
|
||||
@@ -293,12 +347,11 @@
|
||||
|
||||
-(void)codeBtnStateNormal{
|
||||
|
||||
NSAttributedString *att = [GiGaHelper stringWithText:@"发送验证码" textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTBOLD(10) leterSpace:0];
|
||||
[self.codeBtn setAttributedTitle:att forState:UIControlStateNormal];
|
||||
|
||||
if (self.timer) {
|
||||
[self.timer invalidate];
|
||||
self.timer = nil;
|
||||
}
|
||||
self.time =60;
|
||||
self.codeBtn.userInteractionEnabled = YES;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -318,12 +371,14 @@
|
||||
[self finishBtn:btn wtihNewPhone:phonenumber];
|
||||
|
||||
}else{
|
||||
|
||||
btn.userInteractionEnabled = YES;
|
||||
[self.view hideToastActivity];
|
||||
self.nextSteep = YES;
|
||||
self.oldCode = code;
|
||||
[self codeBtnStateNormal];
|
||||
[self.tableView reloadData];
|
||||
[self codeBtnStateNormal];
|
||||
|
||||
}
|
||||
|
||||
}else{
|
||||
@@ -334,10 +389,7 @@
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)dealloc{
|
||||
[self.timer invalidate];
|
||||
self.timer = nil;
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
#import "GiGaFeedBackKindView.h"
|
||||
#import "GIGaUserFileHelper.h"
|
||||
#import "GiGaServerConfig.h"
|
||||
|
||||
@interface GiGaFeedBackViewController ()
|
||||
#import <Photos/Photos.h>
|
||||
@interface GiGaFeedBackViewController ()<UIImagePickerControllerDelegate,UINavigationControllerDelegate>
|
||||
@property(nonatomic,strong) NSMutableArray *imagesUrl;
|
||||
@property(nonatomic,copy) NSString *kinCode;
|
||||
@property(nonatomic,strong) UIButton *tijiaoBtn;
|
||||
@@ -58,9 +58,9 @@
|
||||
[footer addSubview:btn];
|
||||
self.tijiaoBtn = btn;
|
||||
self.tableView.tableFooterView = footer;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
return 4;
|
||||
}
|
||||
@@ -96,16 +96,18 @@
|
||||
|
||||
__weak typeof(cell) weakCell = cell;
|
||||
cell.pickerBalock = ^{
|
||||
[[SJPhotoPicker shareSJPhotoPicker] showPhotoPickerToController:self pickedAssets:^(NSArray<PHAsset *> *assets) {
|
||||
|
||||
if ((weakCell.images.count + assets.count) > 6) {
|
||||
GIGA_ShowToast(@"最多六张");
|
||||
return ;
|
||||
}
|
||||
[weakCell.images addObjectsFromArray:assets];
|
||||
[weakCell.collectionView reloadData];
|
||||
|
||||
}];
|
||||
// [[SJPhotoPicker shareSJPhotoPicker] showPhotoPickerToController:self pickedAssets:^(NSArray<PHAsset *> *assets) {
|
||||
//
|
||||
// if ((weakCell.images.count + assets.count) > 6) {
|
||||
// GIGA_ShowToast(@"最多六张");
|
||||
// return ;
|
||||
// }
|
||||
// [weakCell.images addObjectsFromArray:assets];
|
||||
// [weakCell.collectionView reloadData];
|
||||
//
|
||||
//
|
||||
// }];
|
||||
[self showAcitonSheet];
|
||||
};
|
||||
|
||||
return cell;
|
||||
@@ -200,36 +202,29 @@
|
||||
|
||||
dic = @{@"type":self.kinCode,@"content":contencell.contentFiled.text,@"contact":qqcom
|
||||
};
|
||||
//图片非必选
|
||||
if (self.imagesUrl.count <= 0) {
|
||||
//未选择图片 设置空数组
|
||||
[self uploadFeedinfo:dic imgUrlList:self.imagesUrl];
|
||||
|
||||
}else{
|
||||
////获取图片链接
|
||||
[self uploadImags:dic];
|
||||
}
|
||||
|
||||
|
||||
[self uploadImags:dic];
|
||||
}
|
||||
|
||||
//先上传图片获取到 imageurls 再 提交内容信息
|
||||
//先上传图片获取到 imageurls
|
||||
-(void)uploadImags:(NSDictionary *)params{
|
||||
[self.imagesUrl removeAllObjects];
|
||||
|
||||
GIGaFeedPhontosViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:3]];
|
||||
NSArray *names =cell.imageNames;
|
||||
if (names.count <= 0) {
|
||||
GIGA_ShowToast(@"请选择图片");
|
||||
//图片非必须传
|
||||
[self uploadFeedinfo:params imgUrlList:self.imagesUrl];
|
||||
GILog(@"未选择图片");
|
||||
return;
|
||||
}
|
||||
NSLog(@"names:%@",names);
|
||||
[self.view makeToastActivity:CSToastPositionCenter];
|
||||
//.串行队列同步执行:任务都在当前线程执行(同步),并且顺序执行(串行)
|
||||
//依次上传一次一张
|
||||
dispatch_queue_t queue = dispatch_queue_create("serialQueue", DISPATCH_QUEUE_SERIAL);
|
||||
|
||||
|
||||
|
||||
for (NSUInteger i= 0; i < names.count; i ++) {
|
||||
|
||||
dispatch_sync(queue, ^{
|
||||
@@ -248,9 +243,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 单张上传
|
||||
|
||||
-(void)uploadImage:(NSData *)imageData name:(NSString *)name info:(NSDictionary *)info totalCount:(NSInteger)count{
|
||||
[self.view makeToastActivity:CSToastPositionCenter];
|
||||
self.tijiaoBtn.userInteractionEnabled = NO;
|
||||
@@ -278,6 +271,7 @@
|
||||
[GiGaBaseAPiRequest userTokenTimeOutGologinFromVC:self];
|
||||
|
||||
}else{
|
||||
|
||||
GIGA_ShowToast(result.message);
|
||||
self.tijiaoBtn.userInteractionEnabled = YES;
|
||||
}
|
||||
@@ -322,6 +316,7 @@
|
||||
}
|
||||
//多张
|
||||
-(void)mutipuleUpload{
|
||||
|
||||
// [GiGaNetManager uploadImage:kUploadFeed imageNames:names parms:@{@"file":@"file"} responseBlock:^(NSDictionary *responseDict, NSDictionary *responseHeaderFields, NSError *error) {
|
||||
// [self.view hideToastActivity];
|
||||
// if (error) {
|
||||
@@ -352,6 +347,152 @@
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
-(void)showAcitonSheet{
|
||||
|
||||
[self jxt_showActionSheetWithTitle:@"选择图片" message:@"" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) {
|
||||
|
||||
alertMaker.addActionDefaultTitle(@"拍照");
|
||||
alertMaker.addActionDefaultTitle(@"相册");
|
||||
alertMaker.addActionCancelTitle(@"取消");
|
||||
} actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) {
|
||||
|
||||
if (buttonIndex == 0) {
|
||||
[self satartCamera];
|
||||
}else if (buttonIndex == 1){
|
||||
[self fromAlbums];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)fromAlbums{
|
||||
|
||||
GIGaFeedPhontosViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:3]];
|
||||
[[SJPhotoPicker shareSJPhotoPicker] showPhotoPickerToController:self pickedAssets:^(NSArray<PHAsset *> *assets) {
|
||||
|
||||
if (assets.count == 0) {
|
||||
return ;
|
||||
}
|
||||
|
||||
for (NSInteger i= 0; i < assets.count; i++) {
|
||||
|
||||
|
||||
[cell.images addObject:assets[i]];
|
||||
if ((cell.images.count) == 6) {
|
||||
GIGA_ShowToast(@"最多六张");
|
||||
break;
|
||||
}
|
||||
}
|
||||
[cell.collectionView reloadData];
|
||||
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
-(void)satartCamera{
|
||||
|
||||
GIGaFeedPhontosViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:3]];
|
||||
if ((cell.images.count + 1) > 6) {
|
||||
GIGA_ShowToast(@"最多六张");
|
||||
return ;
|
||||
}
|
||||
|
||||
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init]; imagePickerController.delegate = self; imagePickerController.allowsEditing = YES;
|
||||
|
||||
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
|
||||
|
||||
//权限判断应用是否有使用相机的权限
|
||||
NSString *mediaType = AVMediaTypeVideo;//读取媒体类型
|
||||
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:mediaType];//读取设备授权状态
|
||||
if(authStatus == AVAuthorizationStatusRestricted || authStatus == AVAuthorizationStatusDenied){
|
||||
NSString *errorStr = @"应用相机权限受限,请在设置中启用";
|
||||
[self jxt_showAlertWithTitle:@"" message:errorStr appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) {
|
||||
alertMaker.addActionCancelTitle(@"取消");
|
||||
alertMaker.addActionDefaultTitle(@"去开启");
|
||||
|
||||
} actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) {
|
||||
|
||||
if (buttonIndex == 1) {
|
||||
|
||||
NSString *urlStr = @"App-Prefs:root=Photos";
|
||||
if (@available(iOS 10.0, *)) {
|
||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlStr] options:@{} completionHandler:nil];
|
||||
} else {
|
||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlStr]];
|
||||
// Fallback on earlier versions
|
||||
}
|
||||
}
|
||||
}];
|
||||
return;
|
||||
}
|
||||
// 设置数据源
|
||||
imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
|
||||
[self presentViewController:imagePickerController animated:YES completion:nil];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker{
|
||||
[picker dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<UIImagePickerControllerInfoKey,id> *)info
|
||||
{
|
||||
[picker dismissViewControllerAnimated:YES completion:nil];
|
||||
GIGaFeedPhontosViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:3]];
|
||||
|
||||
UIImage*imge=[info objectForKey:UIImagePickerControllerEditedImage];
|
||||
// 保存相片到相机胶卷
|
||||
NSError *error = nil;
|
||||
//__block PHObjectPlaceholder *createdAsset = nil;
|
||||
NSMutableArray *imageIds = [NSMutableArray array];
|
||||
[[PHPhotoLibrary sharedPhotoLibrary] performChangesAndWait:^{
|
||||
PHAssetChangeRequest *req = [PHAssetChangeRequest creationRequestForAssetFromImage:imge];
|
||||
[imageIds addObject:req.placeholderForCreatedAsset.localIdentifier];
|
||||
|
||||
} error:&error];
|
||||
|
||||
if (error) {
|
||||
NSLog(@"%@",error.localizedDescription);
|
||||
|
||||
}else{
|
||||
|
||||
__block PHAsset *imageAsset = nil;
|
||||
PHFetchResult *result = [PHAsset fetchAssetsWithLocalIdentifiers:imageIds options:nil];
|
||||
[result enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
imageAsset = obj;
|
||||
*stop = YES;
|
||||
}];
|
||||
|
||||
if (imageAsset) {
|
||||
|
||||
[cell.images addObject:imageAsset];
|
||||
[cell.collectionView reloadData];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - < 获取相册里的所有图片的PHAsset对象 >
|
||||
- (NSArray *)getAllPhotosAssetInAblumCollection:(PHAssetCollection *)assetCollection ascending:(BOOL)ascending {
|
||||
// 存放所有图片对象
|
||||
NSMutableArray *assets = [NSMutableArray array];
|
||||
// 是否按创建时间排序
|
||||
PHFetchOptions *option = [[PHFetchOptions alloc] init]; option.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:ascending]]; option.predicate = [NSPredicate predicateWithFormat:@"mediaType == %ld", PHAssetMediaTypeImage];
|
||||
// 获取所有图片对象
|
||||
PHFetchResult *result = [PHAsset fetchAssetsInAssetCollection:assetCollection options:option];
|
||||
// 遍历
|
||||
[result enumerateObjectsUsingBlock:^(PHAsset *asset, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
[assets addObject:asset];
|
||||
|
||||
}];
|
||||
return assets;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#import "GiGaNetManager.h"
|
||||
#import "GiGaServerConfig.h"
|
||||
#import "GiGaAPIResult.h"
|
||||
#import "JobModel.h"
|
||||
|
||||
@interface GiGaUserViewController ()<LYSDatePickerSelectDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate>
|
||||
@property (nonatomic,strong) GiGaUser *user;
|
||||
@@ -63,6 +64,7 @@
|
||||
}
|
||||
|
||||
-(void)creatTab{
|
||||
|
||||
[self.view addSubview:self.tableView];
|
||||
self.tableView.delegate = self;
|
||||
self.tableView.dataSource = self;
|
||||
@@ -134,7 +136,7 @@
|
||||
|
||||
}
|
||||
[cell loadCellData:indexPath user:self.user];
|
||||
//0 女 1 男
|
||||
//2 女 1 男
|
||||
weakify(self);
|
||||
[cell userSelectSexAction:^(int sex) {
|
||||
weakSelf.user.sexCode = sex;
|
||||
@@ -166,8 +168,9 @@
|
||||
}];
|
||||
}];
|
||||
[cell setButtnImage:self.jobSpread with:self.jobArr];
|
||||
[cell userSelectjob:^(NSString *title) {
|
||||
self.user.occupationCode = title;
|
||||
[cell userSelectjob:^(JobModel *job) {
|
||||
self.user.occupationCode = job.dictCode;
|
||||
self.user.occupationName = job.dictLabel;
|
||||
|
||||
[UIView performWithoutAnimation:^{
|
||||
[tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:3 inSection:2]] withRowAnimation:UITableViewRowAnimationNone];
|
||||
@@ -372,11 +375,12 @@
|
||||
GiGaBaseAPiRequest *api =[GiGaBaseAPiRequest initWithRequestPath:kApiOccuption method:RequestPostMethod parms:param];
|
||||
[api requstDataWithResult:^(GiGaAPIResult *result) {
|
||||
if (result.success) {
|
||||
// GILog(@"%@",result.dic);
|
||||
GILog(@"%@",result.dic);
|
||||
NSDictionary *dic = result.dic;
|
||||
NSArray *josA = dic[@"list"];
|
||||
for (NSDictionary *jobDic in josA ) {
|
||||
[self.jobArr addObject:jobDic[@"dictLabel"]];
|
||||
JobModel *mdel = [[JobModel alloc] initWithDictionary:jobDic error:nil];
|
||||
[self.jobArr addObject:mdel];
|
||||
}
|
||||
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:3] withRowAnimation:UITableViewRowAnimationNone];
|
||||
|
||||
@@ -395,7 +399,8 @@
|
||||
|
||||
-(void)showCameraAndPhotoAlert{
|
||||
|
||||
UIAlertController *alertSheet = [UIAlertController alertControllerWithTitle:@"选择头像" message:nil preferredStyle:UIAlertControllerStyleActionSheet]; UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init]; imagePickerController.delegate = self; imagePickerController.allowsEditing = YES;
|
||||
UIAlertController *alertSheet = [UIAlertController alertControllerWithTitle:@"选择头像" message:nil preferredStyle:UIAlertControllerStyleActionSheet];
|
||||
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init]; imagePickerController.delegate = self; imagePickerController.allowsEditing = YES;
|
||||
|
||||
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
|
||||
UIAlertAction *cameraAction = [UIAlertAction actionWithTitle:@"拍照" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
||||
|
||||
@@ -87,7 +87,14 @@
|
||||
cell.timeLabe.text = [NSString stringWithFormat:@"%ld",(long)self.totalMinute];
|
||||
|
||||
if (self.exquisitePercent) {
|
||||
cell.rankLabe.text = [NSString stringWithFormat:@"本月超过%@用户",self.exquisitePercent];
|
||||
NSString *text = [NSString stringWithFormat:@"本月超过%@用户",self.exquisitePercent];
|
||||
NSString *percent = self.exquisitePercent;
|
||||
NSRange range = [text rangeOfString:percent];
|
||||
NSMutableAttributedString *atttri =[[NSMutableAttributedString alloc] initWithString:text];
|
||||
[atttri addAttributes:@{NSFontAttributeName:GIGA_TEXTFONTMEDIUM(16)} range:range];
|
||||
//cell.rankLabe.text = [NSString stringWithFormat:@"本月超过%@用户",self.exquisitePercent];
|
||||
cell.rankLabe.attributedText = atttri;
|
||||
|
||||
}
|
||||
|
||||
[cell.guizeBtn addTarget:self action:@selector(guizeShow) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
#import "GIGaAboutUsVC.h"
|
||||
#import "GiGaFeedBackViewController.h"
|
||||
#import "GiGaWebViewController.h"
|
||||
#import "GiGaServerConfig.h"
|
||||
|
||||
@interface GiSysSettingsVC ()
|
||||
|
||||
@end
|
||||
@@ -80,9 +82,9 @@
|
||||
}else if (indexPath.row == 3){
|
||||
// AppVerionDescriptionVC *verVC =[[AppVerionDescriptionVC alloc] init];
|
||||
// [self.navigationController pushViewController:verVC animated:YES];
|
||||
|
||||
//版本说明
|
||||
GiGaWebViewController *webVC = [[GiGaWebViewController alloc] init];
|
||||
webVC.url = @"";
|
||||
webVC.url = kIMPRITNT;
|
||||
webVC.souceType = WebSourceTypeUrlLink;
|
||||
[self.navigationController pushViewController:webVC animated:YES];
|
||||
|
||||
@@ -149,6 +151,7 @@
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
//http://yts.s1.natapp.cc/mask/clearZear.html
|
||||
-(void)userlogOut{
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
@property(nonatomic,copy) NSString *mobileStatusName;
|
||||
@property(nonatomic,copy) NSString *nickName;
|
||||
@property(nonatomic,copy) NSString *occupationCode;
|
||||
@property(nonatomic,copy) NSString *occupationName;
|
||||
@property(nonatomic,copy) NSString *provinceId;
|
||||
@property(nonatomic,copy) NSString *provinceName;
|
||||
@property(nonatomic,assign) int sexCode;
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// JobModel.h
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/29.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import <JSONModel/JSONModel.h>
|
||||
|
||||
@interface JobModel : JSONModel
|
||||
|
||||
@property(nonatomic,copy) NSString *dictLabel;
|
||||
@property(nonatomic,copy) NSString *dictCode;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// JobModel.m
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/29.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import "JobModel.h"
|
||||
|
||||
@implementation JobModel
|
||||
|
||||
+ (BOOL)propertyIsOptional:(NSString *)propertyName{
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -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"/>
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user