new login style
This commit is contained in:
@@ -136,7 +136,11 @@
|
||||
[MBProgressHUD hideHUDForView:self.view animated:YES];
|
||||
GILog(@"短信获取%@",result.message);
|
||||
if (result.success) {
|
||||
|
||||
[self startTimer:btn];
|
||||
|
||||
}else{
|
||||
GIGA_ShowToast(result.message);
|
||||
}
|
||||
}];
|
||||
|
||||
|
||||
@@ -20,10 +20,12 @@
|
||||
#import "GIGAMBHUDHelper.h"
|
||||
#import "GiGaHelper.h"
|
||||
#import "GiGaUserManager.h"
|
||||
#import "NSTimer+Convenience.h"
|
||||
|
||||
@interface GiGaUserLoginVC ()
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *userImagView;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *acountTextField;
|
||||
//0.9+ 改成code
|
||||
@property (weak, nonatomic) IBOutlet UITextField *passwordTextField;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *loginBtn;
|
||||
|
||||
@@ -31,6 +33,8 @@
|
||||
@property (weak, nonatomic) IBOutlet UIButton *registBtn;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIButton *secretBtn;
|
||||
@property(nonatomic,strong) NSTimer*timer;
|
||||
@property(nonatomic) NSInteger time;
|
||||
|
||||
@end
|
||||
|
||||
@@ -38,7 +42,7 @@
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
_time = 60;
|
||||
if (@available(iOS 11.0, *)) {
|
||||
self.backScrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
||||
} else {
|
||||
@@ -96,8 +100,9 @@
|
||||
// NSAttributedString *passholderText = [[NSAttributedString alloc] initWithString:@"密码" attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14],NSForegroundColorAttributeName:[UIColor redColor]}];
|
||||
// self.passwordTextField.attributedPlaceholder = passholderText;
|
||||
UIView *passView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
|
||||
UIImageView *passViewIcon = [[UIImageView alloc] initWithFrame:CGRectMake(15,8, 12, 22)];
|
||||
passViewIcon.image = [UIImage imageNamed:@"icon_key"];
|
||||
UIImageView *passViewIcon = [[UIImageView alloc] initWithFrame:CGRectMake(12,13.5, 18, 13)];
|
||||
|
||||
passViewIcon.image = [UIImage imageNamed:@"ic_note"];
|
||||
[passView addSubview:passViewIcon];
|
||||
self.passwordTextField.leftView = passView;
|
||||
self.passwordTextField.leftViewMode = UITextFieldViewModeAlways;
|
||||
@@ -158,7 +163,7 @@
|
||||
|
||||
}
|
||||
|
||||
#pragma mark 手机号登录
|
||||
#pragma mark 手机号登录 验证码登录
|
||||
-(void)loginBtnAction:(UIButton *)btn{
|
||||
|
||||
if (self.acountTextField.text.length == 0) {
|
||||
@@ -174,56 +179,51 @@
|
||||
GIGA_ShowToast(@"密码不能为空");
|
||||
return;
|
||||
}
|
||||
// BOOL isPass = [GiGaHelper checkPassWord:self.passwordTextField.text];
|
||||
//
|
||||
// if (isPass == NO) {
|
||||
// GIGA_ShowToast(@"请输入6-20位数字和字母组成的密码");
|
||||
// return;
|
||||
// }
|
||||
int leng = [GiGaHelper convertToInt: self.passwordTextField.text];
|
||||
|
||||
if (!(leng >= 6 && leng <= 20)) {
|
||||
GIGA_ShowToast(@"请输入6-20位数字和字母组成的密码");
|
||||
if (self.passwordTextField.text.length == 0) {
|
||||
GIGA_ShowToast(@"请输入验证码");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
[self loginWithAction:btn];
|
||||
|
||||
}
|
||||
|
||||
-(void)loginWithAction:(UIButton *)btn{
|
||||
|
||||
// NSDictionary *weixinInfoDic = [GiGaUserDefault getWeiXinAccessToenDic];
|
||||
// NSDictionary *weixinInfoDic = [GiGaUserDefault getWeiXinAccessToenDic];
|
||||
NSString *wechatCode = [GiGaUserDefault getWeiXinCode];
|
||||
|
||||
NSDictionary *params = nil;
|
||||
if (wechatCode) {
|
||||
|
||||
params = @{
|
||||
@"username":self.acountTextField.text,
|
||||
@"password":self.passwordTextField.text,
|
||||
@"wechatCode":wechatCode,
|
||||
};
|
||||
}else{
|
||||
|
||||
params = @{
|
||||
@"username":self.acountTextField.text,
|
||||
@"password":self.passwordTextField.text
|
||||
};
|
||||
}
|
||||
@"mobile":self.acountTextField.text,
|
||||
@"code":self.passwordTextField.text,
|
||||
@"wechatCode":wechatCode,
|
||||
};
|
||||
|
||||
//[GIGAMBHUDHelper messageAddto:self.view title:@"登录中..."];
|
||||
[self.view makeToastActivity:CSToastPositionCenter];
|
||||
NSString *baseapi = [GiGaServerConfig getMainUrl];
|
||||
NSString *url = [NSString stringWithFormat:@"%@%@",baseapi,kApiUserLogin];
|
||||
[GiGaNetManager userbodyRequest:url params:params completionHandler:^(NSURLResponse *response, NSDictionary *resDic, NSError * _Nullable error) {
|
||||
GILog(@"%@",resDic);
|
||||
//NSString *baseapi = [GiGaServerConfig getMainUrl];
|
||||
//NSString *url = [NSString stringWithFormat:@"%@%@",baseapi,kApiUserloginWithSMSCode];
|
||||
|
||||
// [GiGaNetManager userbodyRequest:url params:params completionHandler:^(NSURLResponse *response, NSDictionary *resDic, NSError * _Nullable error) {
|
||||
// GILog(@"%@",resDic);
|
||||
// [self.view hideToastActivity];
|
||||
// GiGaAPIResult *result = [[GiGaAPIResult alloc] initWithDictionary:resDic];
|
||||
// GILog(@"**登陆***\n code:%ld\n message:%@\n *******\n",result.code,result.message);
|
||||
// if (result.success) {
|
||||
// [self userloginSussecess:resDic];
|
||||
// }else{
|
||||
// GIGA_ShowToast(result.message);
|
||||
// }
|
||||
// }];
|
||||
|
||||
//[GIGAMBHUDHelper messageAddto:self.view title:@"登录中..."];
|
||||
[self.view makeToastActivity:CSToastPositionCenter];
|
||||
GiGaBaseAPiRequest *api = [GiGaBaseAPiRequest initWithRequestPath:kApiUserloginWithSMSCode method:RequestPostMethod parms:params];
|
||||
[api requstDataWithResult:^(GiGaAPIResult *result) {
|
||||
[self.view hideToastActivity];
|
||||
GiGaAPIResult *result = [[GiGaAPIResult alloc] initWithDictionary:resDic];
|
||||
GILog(@"**登陆***\n code:%ld\n message:%@\n *******\n",result.code,result.message);
|
||||
if (result.success) {
|
||||
[self userloginSussecess:resDic];
|
||||
[self userloginSussecess:result.dic];
|
||||
|
||||
}else{
|
||||
GIGA_ShowToast(result.message);
|
||||
@@ -300,7 +300,7 @@
|
||||
}];
|
||||
}
|
||||
|
||||
//上传微信用户信息
|
||||
// 微信登陆
|
||||
-(void)gigaUploadweixinInfo:(NSDictionary *)weiXinUserinfo{
|
||||
|
||||
[self.view makeToastActivity:CSToastPositionCenter];
|
||||
@@ -315,11 +315,10 @@
|
||||
|
||||
}else if([responseDict[@"code"] integerValue] == 500){
|
||||
//登录流程待定
|
||||
[self.view makeToast:responseDict[@"msg"] duration:2.0 position:CSToastPositionCenter];
|
||||
[self jxt_showAlertWithTitle:@"温馨提示" message:@"请先绑定手机账号" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) {
|
||||
//[self.view makeToast:responseDict[@"msg"] duration:2.0 position:CSToastPositionCenter];
|
||||
[self jxt_showAlertWithTitle:@"温馨提示" message:responseDict[@"msg"] appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) {
|
||||
alertMaker.addActionCancelTitle(@"知道了");
|
||||
} actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) {
|
||||
|
||||
}];
|
||||
|
||||
}else{
|
||||
@@ -360,18 +359,57 @@
|
||||
self.acountTextField.text =(NSString *)noti.object;
|
||||
}
|
||||
|
||||
//密码加密按钮
|
||||
//短信验证码按钮
|
||||
-(void)secretBtnAction:(UIButton *)btn{
|
||||
|
||||
btn.selected = !btn.selected;
|
||||
if (btn.selected) {
|
||||
//秘文
|
||||
self.passwordTextField.secureTextEntry = YES;
|
||||
[btn setImage:[UIImage imageNamed:@"btn_tab_notselect"] forState:UIControlStateSelected];
|
||||
}else{
|
||||
self.passwordTextField.secureTextEntry = NO;
|
||||
[btn setImage:[UIImage imageNamed:@"btn_tab_desplay"] forState:UIControlStateNormal];
|
||||
if (![GiGaHelper isPhoneNumber:self.acountTextField.text]) {
|
||||
GIGA_ShowToast(@"请输入正确手机号");
|
||||
return;
|
||||
}
|
||||
|
||||
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
||||
|
||||
NSString *phoneNumber = self.acountTextField.text;
|
||||
NSDictionary *param = @{
|
||||
@"mobile":phoneNumber
|
||||
};
|
||||
GiGaBaseAPiRequest *api = [GiGaBaseAPiRequest initWithRequestPath:kApiIUserLoginSendCode method:RequestPostMethod parms:param];
|
||||
|
||||
[api requstDataWithResult:^(GiGaAPIResult *result) {
|
||||
[MBProgressHUD hideHUDForView:self.view animated:YES];
|
||||
GILog(@"短信获取%@",result.message);
|
||||
|
||||
if (result.success) {
|
||||
[self startTimer:btn];
|
||||
}else{
|
||||
GIGA_ShowToast(result.message);
|
||||
}
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
//短信登录 验证码倒计时
|
||||
-(void)startTimer:(UIButton *)btn{
|
||||
|
||||
btn.userInteractionEnabled = NO;
|
||||
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--;
|
||||
|
||||
if (self->_time==0) {
|
||||
[self.secretBtn setTitle:@"发送短信" forState:UIControlStateNormal];
|
||||
|
||||
self->_time =60;
|
||||
btn.userInteractionEnabled = YES;
|
||||
}
|
||||
|
||||
}];
|
||||
[[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<constraint firstAttribute="height" constant="2" id="4IT-CI-Nj4"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="密码" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Y1I-OE-6t1">
|
||||
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="验证码" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Y1I-OE-6t1">
|
||||
<rect key="frame" x="65" y="311" width="161" height="48"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="48" id="rw6-Ax-vah"/>
|
||||
@@ -63,7 +63,7 @@
|
||||
<constraint firstAttribute="height" constant="2" id="kqB-Hm-kqr"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="chq-bd-6sQ">
|
||||
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="chq-bd-6sQ">
|
||||
<rect key="frame" x="234" y="373" width="76" height="37"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="76" id="7Tc-Zf-bbN"/>
|
||||
@@ -94,7 +94,12 @@
|
||||
<constraint firstAttribute="height" constant="42" id="HyY-eo-8yw"/>
|
||||
<constraint firstAttribute="width" constant="76" id="pz1-th-22o"/>
|
||||
</constraints>
|
||||
<state key="normal" image="btn_tab_desplay"/>
|
||||
<fontDescription key="fontDescription" name="TimesNewRomanPSMT" family="Times New Roman" pointSize="12"/>
|
||||
<inset key="titleEdgeInsets" minX="-73" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
<inset key="imageEdgeInsets" minX="5" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
<state key="normal" title="发送验证码" image="btn_meaasag">
|
||||
<color key="titleColor" red="0.91764705879999997" green="0.30196078430000001" blue="0.30196078430000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</state>
|
||||
</button>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_circle_avatar" translatesAutoresizingMaskIntoConstraints="NO" id="RIl-8E-GcR">
|
||||
<rect key="frame" x="130.5" y="58" width="114" height="114"/>
|
||||
@@ -122,7 +127,7 @@
|
||||
</attributedString>
|
||||
</state>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="F5p-cf-frr">
|
||||
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="F5p-cf-frr">
|
||||
<rect key="frame" x="80" y="373" width="55" height="36"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="55" id="E7Z-DH-nia"/>
|
||||
@@ -180,7 +185,7 @@
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="btn_tab_desplay" width="45" height="20"/>
|
||||
<image name="btn_meaasag" width="76" height="22"/>
|
||||
<image name="btn_wechat" width="126" height="25"/>
|
||||
<image name="img_circle_avatar" width="114" height="114"/>
|
||||
</resources>
|
||||
|
||||
@@ -19,9 +19,12 @@
|
||||
#import "UIImageView+WebCache.h"
|
||||
#import "UIButton+WebCache.h"
|
||||
#import "GiGaUserInfoVC.h"
|
||||
#import "GIGaSharePageViewController.h"
|
||||
|
||||
@interface GIGaMaskShareViewController ()<UIImagePickerControllerDelegate,UINavigationControllerDelegate>
|
||||
@property(nonatomic,strong) GiGaShareModel *model;
|
||||
@property(nonatomic,strong)NSMutableArray *viewControllers;
|
||||
|
||||
@end
|
||||
|
||||
@implementation GIGaMaskShareViewController
|
||||
@@ -177,9 +180,9 @@
|
||||
case 1:
|
||||
{
|
||||
//系统
|
||||
[GIGaUserFileHelper delectShareImage:kUSERSHAREA_IMAGENAME];
|
||||
ShareViewController *share = [[ShareViewController alloc] init];
|
||||
share.model = self.model;
|
||||
//[GIGaUserFileHelper delectShareImage:kUSERSHAREA_IMAGENAME];
|
||||
GIGaSharePageViewController *share = [[GIGaSharePageViewController alloc] initWithControllers:self.viewControllers];
|
||||
//share.model = self.model;
|
||||
[self presentViewController:share animated:NO completion:nil];
|
||||
|
||||
}
|
||||
@@ -198,12 +201,43 @@
|
||||
|
||||
}
|
||||
|
||||
- (NSMutableArray *)viewControllers {
|
||||
if (!_viewControllers) {
|
||||
_viewControllers = [NSMutableArray array];
|
||||
NSArray *descArr = @[@"生活不易,必须美丽",@"长夜漫漫,不如面膜时间",@"敷片面膜,人间值得",@"打开面膜时间,撰写你与美丽的故事",@"人越美丽,责任越大",@"吃得苦中苦,方为人上人",@"该放弃的决不挽留,该留住的决不放手"];
|
||||
NSArray *images = @[@"sharebg_1",@"sharebg_2",@"sharebg_3",@"sharebg_4",@"sharebg_5",@"sharebg_6",@"sharebg_7"];
|
||||
NSArray *shareimages = @[@"share_oneblack",@"share_one",@"share_one",@"share_one",@"share_one",@"share_one",@"share_one"];
|
||||
NSArray *desColor = @[@1,@1,@2,@1,@1,@1,@2];
|
||||
|
||||
NSArray*doingcolorS = @[@2,@3,@2,@2,@2,@2,@2];
|
||||
|
||||
for (int i = 0; i <descArr.count; i++) {
|
||||
ShareViewController *vc = [[ShareViewController alloc] init];
|
||||
GiGaLoaclImageModel *model = [[GiGaLoaclImageModel alloc] init];
|
||||
model.desc = descArr[i];
|
||||
model.localImageName = images[i];
|
||||
model.shareLabeimageName = shareimages[i];
|
||||
model.doingColorflag = [doingcolorS[i] integerValue];
|
||||
model.descColorflag = [desColor[i] integerValue];
|
||||
vc.localModel = model;
|
||||
vc.model = self.model;
|
||||
[_viewControllers addObject:vc];
|
||||
|
||||
}
|
||||
}
|
||||
return _viewControllers;
|
||||
}
|
||||
|
||||
#pragma mark share
|
||||
-(void)shareBtnAction{
|
||||
|
||||
ShareViewController *share = [[ShareViewController alloc] init];
|
||||
share.model = self.model;
|
||||
[self presentViewController:share animated:YES completion:nil];
|
||||
GIGaSharePageViewController *share = [[GIGaSharePageViewController alloc] initWithControllers:self.viewControllers];
|
||||
//share.model = self.model;
|
||||
[self presentViewController:share animated:NO completion:nil];
|
||||
// ShareViewController *share = [[ShareViewController alloc] init];
|
||||
// share.model = self.model;
|
||||
// [self presentViewController:share animated:YES completion:nil];
|
||||
//
|
||||
|
||||
}
|
||||
|
||||
@@ -281,7 +315,6 @@
|
||||
|
||||
-(void)requestshareInfo{
|
||||
|
||||
|
||||
if (self.maskTimeId == nil) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7,11 +7,12 @@
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
//#import "GiGaShareModel.h"
|
||||
@interface GIGaSharePageViewController : UIViewController
|
||||
//@property(nonatomic,strong) GiGaShareModel *model;
|
||||
|
||||
- (instancetype)initWithControllers:(NSArray *)viewControllers;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
|
||||
@@ -8,25 +8,146 @@
|
||||
|
||||
#import "GIGaSharePageViewController.h"
|
||||
|
||||
@interface GIGaSharePageViewController ()
|
||||
@interface GIGaSharePageViewController ()<UIPageViewControllerDataSource,UIPageViewControllerDelegate,UIScrollViewDelegate>
|
||||
|
||||
{
|
||||
BOOL _done; //是否翻页完成
|
||||
NSInteger _currentPage;//当前控制器对应下标
|
||||
}
|
||||
|
||||
@property(nonatomic,strong) UIPageViewController *pageVC;
|
||||
//@property(nonatomic,strong) NSArray *titles;
|
||||
@property(nonatomic,strong) NSArray *viewControllers;
|
||||
@property(nonatomic,strong) UIPageControl *pageControl;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation GIGaSharePageViewController
|
||||
|
||||
- (UIPageControl *)pageControl{
|
||||
if (!_pageControl) {
|
||||
_pageControl = [[UIPageControl alloc] init];
|
||||
_pageControl.frame = CGRectMake(KMainW / 2 - 100, KMainH - 20, 200, 20);
|
||||
_pageControl.numberOfPages = self.viewControllers.count;
|
||||
_pageControl.hidesForSinglePage = YES;
|
||||
_pageControl.userInteractionEnabled = NO;
|
||||
}
|
||||
return _pageControl;
|
||||
}
|
||||
|
||||
- (instancetype)initWithControllers:(NSArray *)viewControllers{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.viewControllers = viewControllers;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
self.view.backgroundColor = [UIColor whiteColor];
|
||||
// Do any additional setup after loading the view.
|
||||
[self addChildViewController:self.pageVC];
|
||||
[self.view addSubview:self.pageVC.view];
|
||||
[self.view addSubview:self.pageControl];
|
||||
}
|
||||
|
||||
/*
|
||||
#pragma mark - Navigation
|
||||
|
||||
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
||||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
||||
// Get the new view controller using [segue destinationViewController].
|
||||
// Pass the selected object to the new view controller.
|
||||
#pragma mark - UIPageViewControllerDataSource
|
||||
// 返回下一个ViewController对象
|
||||
- (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController {
|
||||
|
||||
NSUInteger index = [self indexOfViewController:viewController];
|
||||
|
||||
if (index == NSNotFound) {
|
||||
return nil;
|
||||
}
|
||||
index++;
|
||||
|
||||
if (index == [self.viewControllers count]) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
return self.viewControllers[index];
|
||||
}
|
||||
*/
|
||||
// 返回上一个ViewController对象
|
||||
- (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController {
|
||||
NSUInteger index = [self indexOfViewController:viewController];
|
||||
|
||||
if (index == 0 || index == NSNotFound) {
|
||||
return nil;
|
||||
}
|
||||
index--;
|
||||
|
||||
return self.viewControllers[index];
|
||||
}
|
||||
|
||||
#pragma mark - UIPageViewControllerDelegate
|
||||
|
||||
// 开始翻页调用
|
||||
- (void)pageViewController:(UIPageViewController *)pageViewController willTransitionToViewControllers:(NSArray<UIViewController *> *)pendingViewControllers NS_AVAILABLE_IOS(6_0) {
|
||||
NSLog(@"开始翻页");
|
||||
}
|
||||
// 翻页完成调用
|
||||
- (void)pageViewController:(UIPageViewController *)pageViewController didFinishAnimating:(BOOL)finished previousViewControllers:(NSArray<UIViewController *> *)previousViewControllers transitionCompleted:(BOOL)completed {
|
||||
_done = YES;
|
||||
|
||||
NSInteger index = [self.viewControllers indexOfObject:pageViewController.viewControllers[0]];
|
||||
_currentPage = index;
|
||||
|
||||
[_pageControl setCurrentPage:_currentPage];
|
||||
NSLog(@"翻页完成");
|
||||
}
|
||||
|
||||
-(UIInterfaceOrientation)pageViewControllerPreferredInterfaceOrientationForPresentation:(UIPageViewController *)pageViewController NS_AVAILABLE_IOS(7_0) __TVOS_PROHIBITED {
|
||||
return UIInterfaceOrientationPortrait;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Tool
|
||||
// 根据数组元素,得到下标值
|
||||
- (NSUInteger)indexOfViewController:(UIViewController *)viewControlller {
|
||||
return [self.viewControllers indexOfObject:viewControlller];
|
||||
}
|
||||
#pragma mark - SCrollViewDelegate
|
||||
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
|
||||
{
|
||||
// LOG(@"滚动 = %f", scrollView.contentOffset.x-SCREEN_WIDTH);
|
||||
//CGFloat offsetX = scrollView.contentOffset.x-KMainW;
|
||||
|
||||
if (!_done) {
|
||||
|
||||
[_pageControl setCurrentPage:_currentPage];
|
||||
|
||||
}else
|
||||
{
|
||||
_done = NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (UIPageViewController *)pageVC {
|
||||
|
||||
if (!_pageVC) {
|
||||
|
||||
_pageVC = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:nil];
|
||||
_pageVC.dataSource = self;
|
||||
_pageVC.delegate = self;
|
||||
_pageVC.view.frame = CGRectMake(0,0,KMainW, KMainH);
|
||||
|
||||
for (UIView *subview in _pageVC.view.subviews) {
|
||||
|
||||
[(UIScrollView *)subview setDelegate:self];
|
||||
//设置是否支持手势滑动
|
||||
// [(UIScrollView *)subview setScrollEnabled:NO];
|
||||
|
||||
}
|
||||
[_pageVC setViewControllers:@[self.viewControllers[0]] direction:UIPageViewControllerNavigationDirectionForward animated:YES completion:nil];
|
||||
}
|
||||
|
||||
return _pageVC;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#import "GiGaUserDefault.h"
|
||||
#import "GiGaServerConfig.h"
|
||||
#import "GiGaQuestionVC.h"
|
||||
|
||||
#import "GiGaBaseAPiRequest.h"
|
||||
|
||||
//弹幕控制器
|
||||
@interface GiGaFlingCommitVC ()
|
||||
@@ -161,6 +161,13 @@
|
||||
|
||||
self.commitInputView.SendCommentHandler = ^(NSString *content) {
|
||||
GILog(@"发送->:%@",content);
|
||||
|
||||
BOOL isUserLogin = [GiGaUserDefault isUserLogin];
|
||||
if (!isUserLogin) {
|
||||
[GiGaBaseAPiRequest userTokenTimeOutGologinFromVC:weakSelf];
|
||||
return ;
|
||||
}
|
||||
|
||||
NSArray *arr = @[@{
|
||||
@"content":content,
|
||||
@"room":@"",
|
||||
@@ -175,11 +182,8 @@
|
||||
//socket
|
||||
[self connetction];
|
||||
|
||||
//显示隐藏输入框
|
||||
BOOL isUserLogin = [GiGaUserDefault isUserLogin];
|
||||
if (!isUserLogin) {
|
||||
self.commitInputView.hidden = YES;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
- (MaskTimeTopAnimationView *)animLabeview{
|
||||
if (!_animLabeview) {
|
||||
_animLabeview = [[MaskTimeTopAnimationView alloc] initWithFrame:CGRectMake(0,20+ PhoneX_TopMargin,KMainW - 40 * 2, 44)];
|
||||
NSString *text = @"长时间的使用面膜可能会对您的皮肤造成伤害";
|
||||
NSString *text = @"配合测试结果的时间敷面膜效果更好哦";
|
||||
[_animLabeview animationWithTexts:[NSArray arrayWithObjects:text,@"面膜时间",text, nil]];
|
||||
|
||||
//_animLabeview.backgroundColor = [UIColor blueColor];
|
||||
@@ -185,7 +185,6 @@
|
||||
}else{
|
||||
text = @"测试肤质";
|
||||
}
|
||||
|
||||
NSAttributedString *title = [GiGaHelper stringWithText:text textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTBOLD(18) leterSpace:0];
|
||||
[_startTestButton setAttributedTitle:title forState:UIControlStateNormal];
|
||||
[_startTestButton addTarget:self action:@selector(testBtnAcion:) forControlEvents:UIControlEventTouchUpInside];
|
||||
@@ -207,7 +206,6 @@
|
||||
#pragma mark 弹幕
|
||||
-(void)createInputView{
|
||||
|
||||
|
||||
GiGaFlingCommitVC* GiGaFlingVC = [[GiGaFlingCommitVC alloc] init];
|
||||
if (ISIOS8) {
|
||||
GiGaFlingVC.modalPresentationStyle = UIModalPresentationOverCurrentContext;
|
||||
@@ -240,12 +238,12 @@
|
||||
if (showAppGaurd == NO) {
|
||||
[self showAPPappGaurdView];
|
||||
}
|
||||
|
||||
// [self showUserGaurdView];
|
||||
|
||||
}
|
||||
|
||||
-(void)viewWillDisappear:(BOOL)animated{
|
||||
|
||||
[super viewWillDisappear:animated];
|
||||
[self.navigationController.navigationBar setTranslucent:NO];
|
||||
if([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
|
||||
@@ -259,7 +257,7 @@
|
||||
[self setUpNav];
|
||||
[self initUI];
|
||||
[self addNotify];
|
||||
[self creatBackGroundMusic];
|
||||
//[self creatBackGroundMusic];
|
||||
[self creatMaskTimeSatrtMusic];
|
||||
}
|
||||
|
||||
@@ -268,7 +266,7 @@
|
||||
-(void)maskupSwipeGesture{
|
||||
[self animaMask];
|
||||
}
|
||||
#pragma mark 点击手势
|
||||
#pragma mark 点击手势结束面膜时间
|
||||
-(void)maskTapAction{
|
||||
[self animaMask];
|
||||
}
|
||||
@@ -358,7 +356,6 @@
|
||||
self.cicleProgressView.hidden = YES;
|
||||
self.swipeGaurdimagView.hidden = NO;
|
||||
self.startMaskButton.hidden = NO;
|
||||
|
||||
[self.view layoutIfNeeded];
|
||||
[UIView animateWithDuration:1.0 animations:^{
|
||||
|
||||
@@ -509,7 +506,7 @@
|
||||
}
|
||||
delegate.isMasking = YES;
|
||||
[_startMaskMusic play];
|
||||
[_musicPalyer play];
|
||||
//[_musicPalyer play];
|
||||
// [self setBackGroundPlayingInfo];//锁屏音频信息
|
||||
|
||||
//总时间隔 s
|
||||
@@ -520,7 +517,7 @@
|
||||
//[self showWaringView];
|
||||
|
||||
//app 前台时收到本地通知showAlert 后台时通知提醒
|
||||
[[GiGaLocalNotificationManager localNotifiationCenter] sendLocalNotification:@"面膜时间闹钟" fireTimeInterval:timeInterVal alertAction:@"面膜时间" withIdentifier:kLOCALNotifiID_MASKETIMEEND];
|
||||
[[GiGaLocalNotificationManager localNotifiationCenter] sendLocalNotification:@"面膜时间结束" fireTimeInterval:timeInterVal alertAction:@"面膜时间提醒" withIdentifier:kLOCALNotifiID_MASKETIMEEND];
|
||||
|
||||
}
|
||||
|
||||
@@ -571,10 +568,10 @@
|
||||
//面膜时间结束时设置 全局变量 不再发送本地通知 提醒
|
||||
AppDelegate *delegate =(AppDelegate *) [[UIApplication sharedApplication] delegate];
|
||||
delegate.isMasking = NO;
|
||||
[_musicPalyer stop];
|
||||
//[_musicPalyer stop];
|
||||
|
||||
//震动 需用户手动开启震动模式
|
||||
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
|
||||
|
||||
//复原动画
|
||||
[self endMaskAnimation];
|
||||
|
||||
@@ -583,7 +580,10 @@
|
||||
#pragma mark 开始测试
|
||||
-(void)testBtnAcion:(UIButton *)btn{
|
||||
|
||||
|
||||
// GIGaMaskShareViewController *shareVC = [[GIGaMaskShareViewController alloc] init];
|
||||
// shareVC.maskTimeId = self.currentMaskId;
|
||||
// [self.navigationController pushViewController:shareVC animated:YES];
|
||||
// return;
|
||||
// NSDictionary *dic = @{
|
||||
// @"dryness":@"0.41",
|
||||
// @"drynessPercent":@"41%",
|
||||
@@ -763,7 +763,6 @@
|
||||
GiGaUserLoginVC *userlogInVC= [[GiGaUserLoginVC alloc] init];
|
||||
GiGaBaseNavViewController *baseNav = [[GiGaBaseNavViewController alloc] initWithRootViewController:userlogInVC];
|
||||
[self presentViewController:baseNav animated:YES completion:nil];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -854,7 +853,6 @@
|
||||
[self.navigationController pushViewController:shareVC animated:YES];
|
||||
}
|
||||
}];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -894,7 +892,6 @@
|
||||
[api requstDataWithResult:^(GiGaAPIResult *result) {
|
||||
if (result.success) {
|
||||
GILog(@"%@",@"面膜时间APi结束");
|
||||
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -8,8 +8,10 @@
|
||||
|
||||
#import "GiGaBaseViewController.h"
|
||||
#import "GiGaShareModel.h"
|
||||
#import "GiGaLoaclImageModel.h"
|
||||
|
||||
@interface ShareViewController : GiGaBaseViewController
|
||||
@property(nonatomic,strong) GiGaShareModel *model;
|
||||
@property(nonatomic,strong) GiGaLoaclImageModel *localModel;
|
||||
|
||||
@end
|
||||
|
||||
@@ -20,34 +20,35 @@
|
||||
#import "UIImage+ShotImage.h"
|
||||
#import "GiGaBaseAPiRequest.h"
|
||||
#import "UIImageView+WebCache.h"
|
||||
#import "GIGaSharePageViewController.h"
|
||||
#import "LXCustomActionSheet.h"
|
||||
|
||||
@interface ShareViewController ()<UITableViewDelegate,UITableViewDataSource,UIImagePickerControllerDelegate,UINavigationControllerDelegate>
|
||||
@property(nonatomic,strong) UITableView *tab;
|
||||
@property(nonatomic,strong) UIImageView *backimageview ;
|
||||
@property(nonatomic) int curentImageIndex ;
|
||||
@property(nonatomic,strong) NSArray *descArr;
|
||||
//
|
||||
@property(nonatomic,strong)NSMutableArray *viewControllers;
|
||||
|
||||
@end
|
||||
|
||||
@implementation ShareViewController
|
||||
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
_curentImageIndex = 5;
|
||||
|
||||
[self creatTabUI];
|
||||
self.descArr = @[@"生活不易,必须美丽",@"长夜漫漫,不如面膜时间",@"敷片面膜,人间值得",@"打开面膜时间,撰写你与美丽的故事",@"人越美丽,责任越大",@"吃得苦中苦,方为人上人",@"该放弃的决不挽留,该留住的决不放手"];
|
||||
|
||||
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
backBtn.frame = CGRectMake(20,20 +PhoneX_TopMargin, 40, 40);
|
||||
backBtn.frame = CGRectMake(15,20 +PhoneX_TopMargin, 40, 40);
|
||||
[backBtn setImage:[UIImage imageNamed:@"btn_moment_back"] forState:UIControlStateNormal];
|
||||
|
||||
[backBtn addTarget:self action:@selector(backBtnAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self.view addSubview:backBtn];
|
||||
|
||||
|
||||
[self creatBtns];
|
||||
|
||||
NC_ADD_TARGET_NAME_OBJECT(self, @selector(usershareSuccessNoti), NC_UseShareSuccessNoti, nil);
|
||||
|
||||
}
|
||||
@@ -69,10 +70,15 @@
|
||||
backimageview.contentMode = UIViewContentModeScaleAspectFill;
|
||||
backimageview.frame = CGRectMake(0,0,self.view.frame.size.width, self.view.frame.size.height);
|
||||
backimageview.userInteractionEnabled = YES;
|
||||
backimageview.image = [GIGaUserFileHelper getUserShareImage:kUSERSHAREA_IMAGENAME];
|
||||
|
||||
self.backimageview = backimageview;
|
||||
//默认背景 拍照 相册 或本地
|
||||
if (self.localModel) {
|
||||
backimageview.image = [UIImage imageNamed:self.localModel.localImageName];
|
||||
}else{
|
||||
|
||||
backimageview.image = [GIGaUserFileHelper getUserShareImage:kUSERSHAREA_IMAGENAME];
|
||||
}
|
||||
|
||||
self.backimageview = backimageview;
|
||||
self.tab.backgroundView = backimageview;
|
||||
|
||||
}
|
||||
@@ -91,8 +97,31 @@
|
||||
cell = [[[NSBundle mainBundle] loadNibNamed:@"MaskTimeShareViewCell" owner:self options:nil] lastObject];
|
||||
|
||||
}
|
||||
//默认
|
||||
cell.descLabe.text = self.descArr[self.curentImageIndex];
|
||||
|
||||
if (self.localModel) {
|
||||
//本地
|
||||
cell.descLabe.text = self.localModel.desc;
|
||||
if (self.localModel.descColorflag == 1) {
|
||||
cell.descLabe.textColor = [UIColor whiteColor];
|
||||
}else{
|
||||
cell.descLabe.textColor = [UIColor blackColor];
|
||||
}
|
||||
|
||||
if (self.localModel.doingColorflag == 1) {
|
||||
cell.doinglabel.textColor = [UIColor whiteColor];
|
||||
}else if (self.localModel.descColorflag == 3){
|
||||
cell.doinglabel.textColor = GIGARGB(170, 170, 170, 1);
|
||||
}else{
|
||||
cell.doinglabel.textColor = [UIColor blackColor];
|
||||
}
|
||||
cell.shareLabe.image = [UIImage imageNamed:self.localModel.shareLabeimageName];
|
||||
|
||||
|
||||
}else{
|
||||
//默认
|
||||
cell.descLabe.text = @"现在做些什么呢?";
|
||||
}
|
||||
|
||||
return cell;
|
||||
|
||||
}else if (indexPath.row == 1){
|
||||
@@ -119,6 +148,7 @@
|
||||
cell = [[[NSBundle mainBundle] loadNibNamed:@"MaskShareBoootomViewCell" owner:self options:nil] lastObject];
|
||||
|
||||
}
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
||||
@@ -167,8 +197,8 @@
|
||||
[shareBtn addTarget:self action:@selector(shareBtnAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
shareBtn.layer.masksToBounds = YES;
|
||||
shareBtn.layer.cornerRadius = 4;
|
||||
|
||||
[self.view addSubview:shareBtn];
|
||||
|
||||
[shareBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(120, 40));
|
||||
make.bottom.mas_equalTo(self.view.mas_bottom).mas_offset(-45);
|
||||
@@ -176,6 +206,13 @@
|
||||
|
||||
}];
|
||||
|
||||
if (self.localModel) {
|
||||
changeBtn.hidden = YES;
|
||||
[shareBtn mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view.mas_centerX);
|
||||
}];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//更换背景
|
||||
@@ -193,32 +230,11 @@
|
||||
case 1:
|
||||
{
|
||||
//系统
|
||||
self.curentImageIndex ++;
|
||||
|
||||
if (self.curentImageIndex > 6) {
|
||||
|
||||
self.curentImageIndex = 0;
|
||||
}
|
||||
|
||||
NSArray *images = @[@"sharebg_1",@"sharebg_2",@"sharebg_3",@"sharebg_4",@"sharebg_5",@"sharebg_6",@"sharebg_7"];
|
||||
|
||||
[self.backimageview setImage:[UIImage imageNamed: images[self->_curentImageIndex]]];
|
||||
|
||||
MaskTimeShareViewCell *cell = [self.tab cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
|
||||
|
||||
NSArray *shareimages = @[@"share_oneblack",@"share_one",@"share_one",@"share_one",@"share_one",@"share_one",@"share_one"];
|
||||
|
||||
NSArray*doingcolorS = @[[UIColor blackColor],GIGARGB(170, 170, 170, 1),[UIColor blackColor],[UIColor blackColor],[UIColor blackColor],[UIColor blackColor],[UIColor blackColor]];
|
||||
|
||||
cell.shareLabe.image = [UIImage imageNamed:shareimages[self.curentImageIndex]];
|
||||
cell.doinglabel.textColor = doingcolorS[self.curentImageIndex];
|
||||
|
||||
NSArray *descArr = @[@"生活不易,必须美丽",@"长夜漫漫,不如面膜时间",@"敷片面膜,人间值得",@"打开面膜时间,撰写你与美丽的故事",@"人越美丽,责任越大",@"吃得苦中苦,方为人上人",@"该放弃的决不挽留,该留住的决不放手"];
|
||||
NSArray *desColor = @[[UIColor whiteColor],[UIColor whiteColor],[UIColor blackColor],[UIColor whiteColor],[UIColor whiteColor],[UIColor whiteColor],[UIColor blackColor]];
|
||||
cell.descLabe.text = descArr[self.curentImageIndex];
|
||||
cell.descLabe.textColor = desColor[self.curentImageIndex];
|
||||
|
||||
GIGaSharePageViewController *share = [[GIGaSharePageViewController alloc] initWithControllers:self.viewControllers];
|
||||
|
||||
//share.model = self.model;
|
||||
[self presentViewController:share animated:NO completion:nil];
|
||||
|
||||
}
|
||||
break;
|
||||
@@ -258,7 +274,6 @@
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//拍照
|
||||
@@ -313,25 +328,27 @@
|
||||
GIGA_ShowToast(@"未安装微信");
|
||||
return;
|
||||
}
|
||||
|
||||
UIImage *image = [UIImage saveLongImage:self.tab];
|
||||
[self jxt_showActionSheetWithTitle:@"分享到微信" message:@"" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) {
|
||||
|
||||
alertMaker.addActionDefaultTitle(@"微信好友");
|
||||
alertMaker.addActionDefaultTitle(@"朋友圈");
|
||||
alertMaker.addActionCancelTitle(@"取消");
|
||||
} actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) {
|
||||
UIImage *image = [UIImage saveLongImage:self.tab];
|
||||
LXCustomActionSheet *sheet = [[LXCustomActionSheet alloc] initWithTitle:@"分享到微信" optionsArr:@[@"微信好友",@"朋友圈"] cancelTitle:@"取消" selectedBlock:^(NSInteger index) {
|
||||
|
||||
if (buttonIndex==0) {
|
||||
if (index==0) {
|
||||
|
||||
//好友
|
||||
[self shareImagToWX:image scene:WXSceneSession];
|
||||
|
||||
}else if (buttonIndex==1){
|
||||
// 朋友圈
|
||||
|
||||
}else if (index==1){
|
||||
|
||||
// 朋友圈
|
||||
[self shareImagToWX:image scene:WXSceneTimeline];
|
||||
}
|
||||
|
||||
} cancelBlock:^{
|
||||
|
||||
GILog(@"取消");
|
||||
}];
|
||||
|
||||
[sheet show];
|
||||
|
||||
}
|
||||
|
||||
-(void)shareImagToWX:(UIImage *)image scene:(int)scene{
|
||||
@@ -362,4 +379,31 @@
|
||||
}
|
||||
|
||||
|
||||
- (NSMutableArray *)viewControllers {
|
||||
if (!_viewControllers) {
|
||||
_viewControllers = [NSMutableArray array];
|
||||
NSArray *descArr = @[@"生活不易,必须美丽",@"长夜漫漫,不如面膜时间",@"敷片面膜,人间值得",@"打开面膜时间,撰写你与美丽的故事",@"人越美丽,责任越大",@"吃得苦中苦,方为人上人",@"该放弃的决不挽留,该留住的决不放手"];
|
||||
NSArray *images = @[@"sharebg_1",@"sharebg_2",@"sharebg_3",@"sharebg_4",@"sharebg_5",@"sharebg_6",@"sharebg_7"];
|
||||
NSArray *shareimages = @[@"share_oneblack",@"share_one",@"share_one",@"share_one",@"share_one",@"share_one",@"share_one"];
|
||||
NSArray *desColor = @[@1,@1,@2,@1,@1,@1,@2];
|
||||
|
||||
NSArray*doingcolorS = @[@2,@3,@2,@2,@2,@2,@2];
|
||||
|
||||
for (int i = 0; i <descArr.count; i++) {
|
||||
ShareViewController *vc = [[ShareViewController alloc] init];
|
||||
GiGaLoaclImageModel *model = [[GiGaLoaclImageModel alloc] init];
|
||||
model.desc = descArr[i];
|
||||
model.localImageName = images[i];
|
||||
model.shareLabeimageName = shareimages[i];
|
||||
model.doingColorflag = [doingcolorS[i] integerValue];
|
||||
model.descColorflag = [desColor[i] integerValue];
|
||||
|
||||
vc.localModel = model;
|
||||
[_viewControllers addObject:vc];
|
||||
|
||||
}
|
||||
}
|
||||
return _viewControllers;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -477,7 +477,10 @@
|
||||
[self.navigationController pushViewController:resultVC animated:YES];
|
||||
|
||||
}else{
|
||||
|
||||
if (result.code == 401) {
|
||||
//token失效
|
||||
[GiGaBaseAPiRequest userTokenTimeOutGologinFromVC:self];
|
||||
}
|
||||
GIGA_ShowToast(result.message);
|
||||
}
|
||||
|
||||
@@ -531,4 +534,5 @@
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -287,8 +287,10 @@
|
||||
if (self.model == nil) {
|
||||
return 255;
|
||||
}
|
||||
if (KMainW < 375) {
|
||||
return 201;
|
||||
if (KMainW == 375) {
|
||||
return (KMainH - SAFE_NAV_HEIGHT) / 3.00 - 10;
|
||||
}else if (KMainW <= 375){
|
||||
return 201;
|
||||
}
|
||||
CGFloat viewH = self.view.frame.size.height - SAFE_NAV_HEIGHT;
|
||||
CGFloat cellH = viewH / 3;
|
||||
|
||||
@@ -89,12 +89,22 @@
|
||||
[self addSubview:minueImageview];
|
||||
[minueImageview mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
|
||||
make.left.mas_equalTo(colorView.mas_left).offset(20);
|
||||
if (KMainW < 375) {
|
||||
//se 5s
|
||||
make.size.mas_equalTo(CGSizeMake(48, 49));
|
||||
//make.left.mas_equalTo(colorView.mas_left).offset(20);
|
||||
if (KMainW == 375) {
|
||||
//x
|
||||
make.left.mas_equalTo(colorView.mas_left).offset(30);
|
||||
make.size.mas_equalTo(CGSizeMake(54, 49));
|
||||
|
||||
}else{
|
||||
}
|
||||
else if (KMainW < 375){
|
||||
make.left.mas_equalTo(colorView.mas_left).offset(18);
|
||||
make.size.mas_equalTo(CGSizeMake(48, 49));
|
||||
}else if (KMainW == 414){
|
||||
make.left.mas_equalTo(colorView.mas_left).offset(28);
|
||||
make.size.mas_equalTo(CGSizeMake(54, 49));
|
||||
}
|
||||
else{
|
||||
make.left.mas_equalTo(colorView.mas_left).offset(28);
|
||||
make.size.mas_equalTo(CGSizeMake(72, 49));
|
||||
}
|
||||
make.top.mas_equalTo(jianyiImageView.mas_bottom).offset(20);
|
||||
@@ -104,9 +114,15 @@
|
||||
//时间⌚️
|
||||
UILabel *timeLabel = [[UILabel alloc] init];
|
||||
timeLabel.textColor = [UIColor blackColor];
|
||||
if (KMainW < 375) {
|
||||
if (KMainW == 375) {
|
||||
timeLabel.font = GIGA_TEXTFONTBOLD(26);
|
||||
}else if (KMainW == 414){
|
||||
timeLabel.font = GIGA_TEXTFONTBOLD(30);
|
||||
}
|
||||
else if (KMainW < 375){
|
||||
timeLabel.font = GIGA_TEXTFONTBOLD(24);
|
||||
}else{
|
||||
}
|
||||
else{
|
||||
timeLabel.font = GIGA_TEXTFONTBOLD(35);
|
||||
}
|
||||
timeLabel.text = @"17";
|
||||
|
||||
@@ -8,10 +8,24 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
@interface GiGaLoaclImageModel : NSObject
|
||||
|
||||
//背景图片(本地)
|
||||
@property(nonatomic,copy) NSString *localImageName;
|
||||
//图片序号
|
||||
@property(nonatomic) NSUInteger index;
|
||||
|
||||
//分享面膜时间 staring now 图片名 很白两种
|
||||
@property(nonatomic,copy) NSString *shareLabeimageName;
|
||||
//描述文本颜色 1 白 2 黑 3 GIGARGB(170, 170, 170, 1)
|
||||
@property(nonatomic) NSUInteger descColorflag;
|
||||
//描述文本
|
||||
@property(nonatomic,copy) NSString *desc;
|
||||
//文本颜色 what are we doing 颜色 黑白
|
||||
@property(nonatomic) NSUInteger doingColorflag;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
if (section == 0){
|
||||
return 1;
|
||||
}
|
||||
return 3;
|
||||
return 2;
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
@@ -117,15 +117,11 @@
|
||||
[self.navigationController pushViewController:userVC animated:YES];
|
||||
|
||||
}else{
|
||||
|
||||
if (indexPath.section == 1 && indexPath.row == 0 ){
|
||||
GiGaUserViewController *userVC= [[GiGaUserViewController alloc] init];
|
||||
[self.navigationController pushViewController:userVC animated:YES];
|
||||
|
||||
}else if (indexPath.section == 1 && indexPath.row == 1){
|
||||
|
||||
GIGaChangePassVC *changePass = [[GIGaChangePassVC alloc] init];
|
||||
[self.navigationController pushViewController:changePass animated:YES];
|
||||
|
||||
}else{
|
||||
|
||||
GiGaChangePhoneNumberVC *changePass = [[GiGaChangePhoneNumberVC alloc] init];
|
||||
@@ -133,6 +129,7 @@
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
|
||||
@@ -31,6 +31,6 @@
|
||||
@property(nonatomic,assign) int sexCode;
|
||||
@property(nonatomic,copy) NSString *sexName;
|
||||
@property(nonatomic,copy) NSString *weixin;
|
||||
|
||||
@property(nonatomic) int minute;
|
||||
|
||||
@end
|
||||
|
||||
@@ -21,10 +21,6 @@
|
||||
self.infoTitle.text = @"个人信息";
|
||||
self.numberLabe.hidden = YES;
|
||||
}else if (indexPath.section == 1 && indexPath.row == 1){
|
||||
//修改密码
|
||||
self.infoTitle.text = @"修改密码";
|
||||
self.numberLabe.hidden = YES;
|
||||
}else if (indexPath.section == 1 && indexPath.row == 2){
|
||||
//修改手机
|
||||
self.infoTitle.text = @"修改手机";
|
||||
self.numberLabe.hidden = NO;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
[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;
|
||||
@@ -25,7 +26,8 @@
|
||||
|
||||
-(void)configUserSex:(int)sex{
|
||||
|
||||
if (sex == 2) {
|
||||
if (sex == 2 || sex == 0) {
|
||||
|
||||
[self.usefemale setImage:[UIImage imageNamed:@"sex_selected"] forState:UIControlStateNormal];
|
||||
[self.usermale setImage:[UIImage imageNamed:@"sex_disselect"] forState:UIControlStateNormal];
|
||||
}else{
|
||||
@@ -43,6 +45,7 @@
|
||||
self.actionblock(2);
|
||||
[self configUserSex:2];
|
||||
}
|
||||
|
||||
-(void)userSelectSexAction:(femaleBtnAction)block{
|
||||
self.actionblock = block;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user