add
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// GIGaMaskShareViewController.h
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import "GiGaBaseViewController.h"
|
||||
|
||||
@interface GIGaMaskShareViewController : GiGaBaseViewController
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,113 @@
|
||||
//
|
||||
// GIGaMaskShareViewController.m
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import "GIGaMaskShareViewController.h"
|
||||
#import "MaskTimeEndViewImgaeCell.h"
|
||||
#import "MaskTimeTimeViewCell.h"
|
||||
#import "MaskTimeEndActionViewCell.h"
|
||||
#import "ShareViewController.h"
|
||||
|
||||
@interface GIGaMaskShareViewController ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation GIGaMaskShareViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self addNavTitile:@"面膜时间"];
|
||||
[self.view addSubview:self.tableView];
|
||||
self.tableView.delegate = self;
|
||||
self.tableView.dataSource = self;
|
||||
self.tableView.backgroundColor = [UIColor whiteColor];
|
||||
self.tableView.separatorStyle = UITableViewCellSelectionStyleNone;
|
||||
self.tableView.sectionFooterHeight = 0;
|
||||
self.tableView.estimatedSectionFooterHeight= 0;
|
||||
self.tableView.estimatedSectionHeaderHeight = 0;
|
||||
//self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectMake(0, 0,self.view.frame.size.width, 30)];
|
||||
self.tableView.frame = CGRectMake(0,0,KMainW, self.view.frame.size.height);
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
return 3;
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return 1;
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (indexPath.section == 0) {
|
||||
MaskTimeEndViewImgaeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MaskTimeEndViewImgaeCell"];
|
||||
if (!cell) {
|
||||
cell = [[[NSBundle mainBundle] loadNibNamed:@"MaskTimeEndViewImgaeCell" owner:self options:nil] lastObject];
|
||||
|
||||
}
|
||||
return cell;
|
||||
}else if (indexPath.section == 1){
|
||||
MaskTimeTimeViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MaskTimeTimeViewCell"];
|
||||
if (!cell) {
|
||||
cell = [[[NSBundle mainBundle] loadNibNamed:@"MaskTimeTimeViewCell" owner:self options:nil] lastObject];
|
||||
|
||||
}
|
||||
return cell;
|
||||
|
||||
}else if (indexPath.section == 2){
|
||||
MaskTimeEndActionViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MaskTimeEndActionViewCell"];
|
||||
if (!cell) {
|
||||
cell = [[[NSBundle mainBundle] loadNibNamed:@"MaskTimeEndActionViewCell" owner:self options:nil] lastObject];
|
||||
|
||||
}
|
||||
[cell.changeBackBtn addTarget:self action:@selector(changeBackBtnAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
[cell.shareBtn addTarget:self action:@selector(shareBtnAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
return cell;
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (indexPath.section == 0) {
|
||||
return 285;
|
||||
}else if (indexPath.section == 1){
|
||||
return 205;
|
||||
}
|
||||
|
||||
return 90;
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
|
||||
return 0.1;
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
|
||||
|
||||
{ return 0.1;
|
||||
|
||||
}
|
||||
|
||||
#pragma mark changeBackBtnAction
|
||||
-(void)changeBackBtnAction{
|
||||
|
||||
}
|
||||
|
||||
#pragma mark share
|
||||
-(void)shareBtnAction{
|
||||
|
||||
ShareViewController *share = [[ShareViewController alloc] init];
|
||||
[self presentViewController:share animated:NO completion:nil];
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -32,6 +32,7 @@
|
||||
#import "GiGaUserManager.h"
|
||||
#import "GiGaBaseAPiRequest.h"
|
||||
#import "MaskTestResultVC.h"
|
||||
#import "GIGaMaskShareViewController.h"
|
||||
|
||||
|
||||
@interface GiGaMaskTaskViewController ()<MaskCirCularProGressViewDelegate>
|
||||
@@ -488,18 +489,20 @@
|
||||
|
||||
#pragma mark 开始测试
|
||||
-(void)testBtnAcion:(UIButton *)btn{
|
||||
NSDictionary *dic = @{
|
||||
@"dryness":@"0.41",
|
||||
@"drynessPercent":@"41%",
|
||||
@"mask":@"",
|
||||
@"minute":@"19",
|
||||
@"oiliness":@"0.59",
|
||||
@"oilinessPercent":@"59%"
|
||||
};
|
||||
MaskTestResult *model =[[MaskTestResult alloc] initWithDictionary:dic error:nil];
|
||||
MaskTestResultVC *resultVC = [[MaskTestResultVC alloc] init];
|
||||
resultVC.model = model;
|
||||
[self.navigationController pushViewController:resultVC animated:YES];
|
||||
// NSDictionary *dic = @{
|
||||
// @"dryness":@"0.41",
|
||||
// @"drynessPercent":@"41%",
|
||||
// @"mask":@"",
|
||||
// @"minute":@"19",
|
||||
// @"oiliness":@"0.59",
|
||||
// @"oilinessPercent":@"59%"
|
||||
// };
|
||||
// MaskTestResult *model =[[MaskTestResult alloc] initWithDictionary:dic error:nil];
|
||||
// MaskTestResultVC *resultVC = [[MaskTestResultVC alloc] init];
|
||||
// resultVC.model = model;
|
||||
// [self.navigationController pushViewController:resultVC animated:YES];
|
||||
|
||||
[self showAlertGoShareMaskTime];
|
||||
|
||||
return;
|
||||
GiGaQuestionVC *questionVC = [[GiGaQuestionVC alloc] init];
|
||||
@@ -696,4 +699,23 @@
|
||||
|
||||
}
|
||||
|
||||
#pragma mark 去分享
|
||||
|
||||
-(void)showAlertGoShareMaskTime{
|
||||
|
||||
[self jxt_showAlertWithTitle:@"面膜时间" message:@"去分享我的面膜时间" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) {
|
||||
alertMaker.addActionCancelTitle(@"下次");
|
||||
alertMaker.addActionDefaultTitle(@"去分享");
|
||||
} actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) {
|
||||
|
||||
if (buttonIndex == 1) {
|
||||
|
||||
GIGaMaskShareViewController *shareVC = [[GIGaMaskShareViewController alloc] init];
|
||||
[self.navigationController pushViewController:shareVC animated:YES];;
|
||||
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// ShareViewController.h
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import "GiGaBaseViewController.h"
|
||||
|
||||
@interface ShareViewController : GiGaBaseViewController
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,163 @@
|
||||
//
|
||||
// ShareViewController.m
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import "ShareViewController.h"
|
||||
#import "MaskTimeShareViewCell.h"
|
||||
#import "MaskShareTimeMidViewCell.h"
|
||||
#import "MaskShareBoootomViewCell.h"
|
||||
|
||||
|
||||
@interface ShareViewController ()<UITableViewDelegate,UITableViewDataSource>
|
||||
@property(nonatomic,strong) UITableView *tab;
|
||||
@property(nonatomic,strong) UIImageView *backimageview ;
|
||||
@property(nonatomic) int curentImageIndex ;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation ShareViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
_curentImageIndex = 0;
|
||||
UIImageView *backimageview = [[UIImageView alloc] init];
|
||||
backimageview.frame = CGRectMake(0, 0,self.view.frame.size.width, self.view.frame.size.height);
|
||||
backimageview.userInteractionEnabled = YES;
|
||||
backimageview.image = [UIImage imageNamed:@"sharebg_1"];
|
||||
// self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"sharebg_1"]];
|
||||
self.backimageview = backimageview;
|
||||
[self.view addSubview:backimageview];
|
||||
[self creatTabUI];
|
||||
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
backBtn.frame = CGRectMake(20,44, 40, 40);
|
||||
[backBtn setImage:[UIImage imageNamed:@"btn_moment_back"] forState:UIControlStateNormal];
|
||||
backBtn.backgroundColor = [UIColor redColor];
|
||||
[backBtn addTarget:self action:@selector(backBtnAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self.view addSubview:backBtn];
|
||||
[self.view insertSubview:backimageview atIndex:0];
|
||||
|
||||
[self creatBtns];
|
||||
|
||||
}
|
||||
|
||||
-(void)creatTabUI{
|
||||
self.tab = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
|
||||
self.tab.separatorStyle = UITableViewCellSelectionStyleNone;
|
||||
self.tab.delegate = self;
|
||||
self.tab.dataSource = self;
|
||||
self.tab.backgroundColor = [UIColor clearColor];
|
||||
[self.view addSubview:self.tab];
|
||||
}
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
return 1;
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return 3;
|
||||
}
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (indexPath.row == 0) {
|
||||
MaskTimeShareViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MaskTimeShareViewCell"];
|
||||
if (!cell) {
|
||||
cell = [[[NSBundle mainBundle] loadNibNamed:@"MaskTimeShareViewCell" owner:self options:nil] lastObject];
|
||||
|
||||
}
|
||||
return cell;
|
||||
}else if (indexPath.row == 1){
|
||||
MaskShareTimeMidViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MaskShareTimeMidViewCell"];
|
||||
if (!cell) {
|
||||
cell = [[[NSBundle mainBundle] loadNibNamed:@"MaskShareTimeMidViewCell" owner:self options:nil] lastObject];
|
||||
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
else if (indexPath.row == 2){
|
||||
MaskShareBoootomViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MaskShareBoootomViewCell"];
|
||||
if (!cell) {
|
||||
cell = [[[NSBundle mainBundle] loadNibNamed:@"MaskShareBoootomViewCell" owner:self options:nil] lastObject];
|
||||
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (indexPath.row == 0) {
|
||||
return 295;
|
||||
}else if (indexPath.row ==1){
|
||||
return 205;
|
||||
}
|
||||
return 158;
|
||||
}
|
||||
|
||||
-(void)backBtnAction{
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
-(void)creatBtns{
|
||||
|
||||
UIButton *changeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
changeBtn.backgroundColor = GIGARGB(181, 14, 14, 0.6);
|
||||
NSAttributedString *titl = [GiGaHelper stringWithText:@"更换背景" textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTBOLD(18) leterSpace:0];
|
||||
[changeBtn setAttributedTitle:titl forState:UIControlStateNormal];
|
||||
[changeBtn addTarget:self action:@selector(changeAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
changeBtn.layer.masksToBounds = YES;
|
||||
changeBtn.layer.cornerRadius = 4;
|
||||
[self.view addSubview:changeBtn];
|
||||
[changeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(120, 40));
|
||||
make.bottom.mas_equalTo(self.view.mas_bottom).mas_offset(-45);
|
||||
make.centerX.mas_equalTo(self.view.mas_centerX).offset(-72);
|
||||
|
||||
}];
|
||||
|
||||
UIButton *shareBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
shareBtn.backgroundColor = GIGARGB(181, 14, 14, 0.6);
|
||||
NSAttributedString *titl2 = [GiGaHelper stringWithText:@"分享" textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTBOLD(18) leterSpace:0];
|
||||
[shareBtn setAttributedTitle:titl2 forState:UIControlStateNormal];
|
||||
[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);
|
||||
make.centerX.mas_equalTo(self.view.mas_centerX).offset(72);
|
||||
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
-(void)changeAction{
|
||||
|
||||
_curentImageIndex ++;
|
||||
if (_curentImageIndex == 4) {
|
||||
_curentImageIndex = 0;
|
||||
}
|
||||
NSArray *images = @[@"sharebg_2",@"sharebg_3",@"sharebg_4",@"sharebg_5",@"sharebg_1"];
|
||||
|
||||
[self.backimageview setImage:[UIImage imageNamed: images[_curentImageIndex]]];
|
||||
|
||||
}
|
||||
|
||||
-(void)shareBtnAction{
|
||||
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user