• 曹云霄's avatar
    1、把按照类型筛选放到第一个位置,更风格对掉下。 · 653bf2df
    曹云霄 authored
    2、 红包促销拒绝的原因未能显示(在红包展示信息的时候要包含客户姓名及订单总金额)
    3、在客户界面的搜索框里,输入客户的手机号或则姓名 要支持模糊查询
    4、Ipad端我的红包—更多 点进去之后 显示订单号、时间;增加显示2个字段,客户姓名和订单总额
    5、Ipad闯关区—进入之后显示里去掉 结束时间显示
    6、邀请人显示 可以点击筛选本门店的设计师,弹框出来可以按照设计师的姓名或则电话号码进行模糊查询,选中后显示在界面上的是设计师的手机号码,ipad客户模块UI重新排版,具体参考邮件psd文件,后台会新建一个接口,获取当前门店下的设计师,根据选择的客户,获取到客户所关联的设计师
    653bf2df
CardDetailsViewController.m 3.8 KB
//
//  CardDetailsViewController.m
//  Lighting
//
//  Created by 曹云霄 on 2016/10/19.
//  Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//

#import "CardDetailsViewController.h"
#import "CardDontUseViewController.h"
#import "CardBeenUseViewController.h"

@interface CardDetailsViewController ()

/**
 *  当前的控制器
 */
@property (nonatomic,strong) UIViewController *currentVC;

/**
 指示线约束
 */
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *instructionViewConstraint;

@end

@implementation CardDetailsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self addChildViewController];
}

#pragma mark - 添加卡劵详情vc
- (void)addChildViewController
{
    /// 未领取
    CardDontUseViewController *dontUseVc = [CardDontUseViewController viewControllerWithStoryBoardType:STORYBOARD_TYPE_MAIN];
    [self addChildViewController:dontUseVc];
    /// 已领取
    CardBeenUseViewController *beenUseVc = [CardBeenUseViewController viewControllerWithStoryBoardType:STORYBOARD_TYPE_MAIN];
    // 审批中
    CardBeenUseViewController *examineUseVc = [CardBeenUseViewController viewControllerWithStoryBoardType:STORYBOARD_TYPE_MAIN];
    examineUseVc.cardState = CHECK;
    [self addChildViewController:examineUseVc];

    beenUseVc.cardState = ACTIVED;
    [self addChildViewController:beenUseVc];
    /// 已使用
    CardBeenUseViewController *usedVc = [CardBeenUseViewController viewControllerWithStoryBoardType:STORYBOARD_TYPE_MAIN];
    usedVc.cardState = USED;
    [self addChildViewController:usedVc];
    [self.cardBackgroundView addSubview:dontUseVc.view];
    self.currentVC = dontUseVc;
}

#pragma mark - 布局
- (void)viewDidLayoutSubviews
{
    CardDontUseViewController *dontUseVc = self.childViewControllers[0];
    dontUseVc.view.frame = CGRectMake(0, 0, self.cardBackgroundView.mj_w, self.cardBackgroundView.mj_h);

    CardBeenUseViewController *beenUseVc = self.childViewControllers[1];
    beenUseVc.view.frame = CGRectMake(0, 0, self.cardBackgroundView.mj_w, self.cardBackgroundView.mj_h);

    CardBeenUseViewController *examineUseVc = self.childViewControllers[2];
    examineUseVc.view.frame = CGRectMake(0, 0, self.cardBackgroundView.mj_w, self.cardBackgroundView.mj_h);

    CardBeenUseViewController *usedVc = self.childViewControllers[3];
    usedVc.view.frame = CGRectMake(0, 0, self.cardBackgroundView.mj_w, self.cardBackgroundView.mj_h);
}


#pragma mark - 切换已使用卡劵、未使用卡劵
- (void)switchPaymentsVCAndWithdrawalVC:(UIViewController *)newViewController
{
    [self transitionFromViewController:self.currentVC toViewController:newViewController duration:0.5 options:UIViewAnimationOptionTransitionNone animations:nil completion:^(BOOL finished) {
        if (finished) {
            [self.cardBackgroundView addSubview:newViewController.view];
            self.currentVC = newViewController;
        }
    }];
}

#pragma mark - 切换ContentController
- (IBAction)paymentsButtonAndWithdrawalButtonClick:(UIButton *)sender {
    
    for (id object in self.view.subviews) {
        if ([object isKindOfClass:[UIButton class]]) {
            UIButton *button = (UIButton *)object;
            button.selected = NO;
        }
    }
    sender.selected = YES;
    [self setupInstructionsViewOrigin:sender];
    [self switchPaymentsVCAndWithdrawalVC:self.childViewControllers[sender.tag-100]];
}

#pragma mark - 设置指示线的位置
- (void)setupInstructionsViewOrigin:(UIButton *)sender
{
    self.instructionViewConstraint.constant = sender.x+16;
    [UIView animateWithDuration:0.5 delay:0.1f usingSpringWithDamping:0.5f initialSpringVelocity:0.5f options:UIViewAnimationOptionCurveEaseInOut animations:^{
        [self.view layoutIfNeeded];
    } completion:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}


@end