text:
//
//  HomeViewController.m
//  yyxb
//
//  Created by 杨易 on 15/11/24.
//  Copyright (c) 2015年 杨易. All rights reserved.
//

#import "HomeViewController.h"
#import "AdvertisingCell.h" //轮播
#import "RadioCell.h" //广播
#import "GoodsCell.h" //商品
#import "ClassificationViewController.h" //分类浏览
#import "SearchViewController.h" //搜索
#import "ClassificationGoodsViewController.h" // 共用。 10元  分类....
#import "ProblemViewController.h" //常见问题
#import "LoginViewController.h" //测试登陆
#import "GoodsDetailsViewController.h" //商品详情
#import "OrdershareController.h"   //晒单分享
#import "GoodsModel.h"
#import "AdModel.h"
#import "IanScrollView.h"
#import "MJRefresh.h"
#import "GoodsCollectionViewCell.h"
#import "UIImageView+WebCache.h"
#import "HeadlineScrollview.h"
#import "PWWebViewController.h" //获得网站链接
#import "PictureDetailController.h"
#import "UIImageView+WebCache.h"
#import "LanMuModel.h"
#import "MyStudentController.h"//招募徒弟
#import "NewGoodsModel.h"

#import "LatestAnnouncedModel.h" // model
#import "NewRedController.h"
#import "LatesAnnViewCell.h"
#import "NotifyController.h"

#import "AwardTipView.h"
#import "WinningRecordViewController.h"
#import "EGOImageLoader.h"
#import <ShareSDK/ShareSDK.h>
#import "FindTreasureController.h"
#import "SettlementViewController.h"
#import "SettlementModel.h"
#import "RedPageAlertView.h"
#import "AFNetworking.h"
#import "RegisteredViewController.h"
#import "MyRedViewController.h"
#import "WinRateView.h"
#import "TheWiningCell.h"
#import "HomeCollectionCell.h"
typedef void (^VersionBlock)(NSString *);
@interface HomeViewController ()<UICollectionViewDataSource,UICollectionViewDelegate,HeadlineScrollviewDelegate,GoodsCollectionViewCellDelegate,UIScrollViewDelegate, CloseTipViewDelegate,HomeCollectionCellDelegate>{
    NSInteger       _timedata; //时间计时

    NSString                *_url;      //下载页url
    NSString                *_title;    //推广标题
    NSString                *_content;   //推广内容
    NSString                *_imgurl;

    UILabel* lbtime;
    UILabel* lbtime2;
    UILabel* lbtime3;

    UIView      *_redLine;
    UIView      *_redLine2;
    UIButton    *_lastSelectedBtn;
    UIButton    *_lastSelectedBtn2;
    UIButton *sellerDetail;
}
@property (nonatomic, assign) NSInteger num; //记录当前页数
@property (nonatomic, strong) NSMutableArray *dataArray; //数据源
@property (nonatomic, strong) UIView *buttonView; // 4 分类
@property (nonatomic, strong) UIImageView *shangImageView;
@property (nonatomic, strong) UIImageView *xiaImageView;
@property (nonatomic, strong) NSMutableArray *btns;
@property (nonatomic, copy) NSString *classNum; // 类型
@property (nonatomic, assign) NSInteger tagd; //按钮状态
@property (nonatomic, strong) UICollectionView *collectionView;

@property (nonatomic, strong) UIPageControl *pageControl;
@property (nonatomic, strong) NSMutableArray *imageArray; // 轮播图
@property (nonatomic, strong) IanScrollView *scrollView;

@property (nonatomic, strong) NSMutableArray *barArray; //栏目数组
@property (nonatomic, strong) HeadlineScrollview  *radioScrollView; // 广播
@property (nonatomic, strong) UIView *headerView;  //按钮分类view
@property (nonatomic, strong) UIView *headerView2;
@property (nonatomic,strong) NSMutableArray        *headlineArray;  //首页公告
@property (nonatomic, strong) UITapGestureRecognizer *tap; //手势
@property (nonatomic, assign) int buttonstate; //人气颜色
@property (nonatomic, strong) UIImageView *btn;
@property (nonatomic, strong) NSMutableArray *btnArray;
@property (nonatomic, strong) NSMutableArray *NewGoodsArray;
@property (nonatomic, strong) NSMutableArray *LatesAnnArray;

@property (nonatomic, strong) UICollectionViewFlowLayout *layOut2;

@property (nonatomic, strong) UICollectionView *collectionView2;

@property (nonatomic, strong) NoNetwork *nonetwork;

//Added by Winzlee(liwenzhi)
@property (nonatomic, strong) NSMutableArray  *awardTipArray;
@property (nonatomic, strong) AwardTipView    *awardTipView;
/** 中奖提示索引 */
@property (nonatomic, assign) int             index;

@property (nonatomic,strong)NSString *xinVersion;

@property (nonatomic,copy)VersionBlock block;

@end

static NSString *collectionCellName = @"collectionCell";
static NSString *collectionCellName2 = @"collectionCell";
@implementation HomeViewController
{

    BOOL _isSorting;
    int seleview;
    UIView*latesview;

    int ishave;
}

- (void)viewDidLoad {
    [super viewDidLoad];

//   [self GetLatesAnnounce];

//    [self NewGoodsproduct];

    //            UIView *view1 = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 95 ,24)];
    //            UIImageView *titleView=[[UIImageView alloc] initWithFrame:view1.bounds];
    //            titleView.image = [UIImage imageNamed:@"首页标题logo"];
    //            [view1 addSubview:titleView];
    //            self.navigationItem.titleView= view1;

    self.left.hidden = YES;
    self.headlineArray = [NSMutableArray array];
    _buttonstate=1;

    [self initData];
//    [self initcollectionView];
    [self setNavBar];

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(kaijiangTishi) name:@"homeOpenJiang" object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jiexiaoRes) name:@"jiexiaoResult" object:nil];

      [self gainNewVersion];

    [RedPageAlertView shareInstance].closeBlock = ^(){
        if ([UserDataSingleton userInformation].isLogin) {
            [self closeRequest];
        }
    };
    [RedPageAlertView shareInstance].checkBlock = ^(NSString *title){

        DebugLog(@"%@",title);

        if ([title isEqualToString:@"领取红包"]) {
                // push
                DebugLog(@"push领取红包");

                RegisteredViewController *registerVC = [RegisteredViewController new];
                [self.navigationController pushViewController:registerVC animated:YES];
                [[RedPageAlertView shareInstance] dismiss];
        }else{
            [self getRedPage];
        }
    };

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateVersion) name:@"notificatVersion" object:nil];

}
- (void)updateVersion{

    [self judgeLoginStatus];

    DebugLog(@"版本号:%@",[UserDataSingleton userInformation].currentVersion);

}
- (void)judgeLoginStatus{

    if ([UserDataSingleton userInformation].currentVersion == nil) {
        [SVProgressHUD showErrorWithStatus:@"网络连接失败"];
    }else{
        if ([[UserDataSingleton userInformation].currentVersion isEqualToString:[UserDataSingleton userInformation].xinVersion]) {
            if (![UserDataSingleton userInformation].isLogin) {
                [self loginAgo];
            }else{
                [self queryYesOrNoShow];
            }
        }
    }
}
/** 登陆前 */
- (void)loginAgo{
    [[RedPageAlertView shareInstance] showWithState:YES checkTitle:@"领取红包" imageName:@"redpage_big"];
}
/** 登陆后 */
- (void)loginLate{
    [[RedPageAlertView shareInstance] showWithState:YES checkTitle:@"查看红包" imageName:@"redpage_look"];
}
/** 查询是否显示 */
- (void)queryYesOrNoShow{

    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    NSDictionary *dict = @{@"yhid":[UserDataSingleton userInformation].uid,@"code":[UserDataSingleton userInformation].code};
    [manager GET:@"http://www.miyungou.com/?/app/app/newuser" parameters:dict success:^(NSURLSessionDataTask *task, id responseObject) {

        NSDictionary *resultData = responseObject[@"data"];

        if (!([resultData isEqual:@""])) {
            id status = resultData[@"showStatus"];
            if (![status isEqualToString:@"false"]) {
                [self loginLate];
            }
        }
    } failure:^(NSURLSessionDataTask *task, NSError *error) {

    }];
}
/** 关闭请求 */
- (void)closeRequest{
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    NSDictionary *dict = @{@"yhid":@"",@"code":@""};
    [manager GET:@"http://www.miyungou.com/?/app/app/updateBounsState" parameters:dict success:^(NSURLSessionDataTask *task, id responseObject) {

    } failure:^(NSURLSessionDataTask *task, NSError *error) {

    }];
}
/** 领取红包请求*/
- (void)getRedPage{
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    NSDictionary *dict = @{@"yhid":[UserDataSingleton userInformation].uid,@"code":[UserDataSingleton userInformation].code};
    [manager GET:@"http://www.miyungou.com/?/app/app/getNewBonus" parameters:dict success:^(NSURLSessionDataTask *task, id responseObject) {
        //获取成功,查看红包
        MyRedViewController *myredVC = [MyRedViewController new];
        [self.navigationController pushViewController:myredVC animated:YES];
        [[RedPageAlertView shareInstance] dismiss];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {

    }];
}
#pragma mark - 获取最新版本
- (void)gainNewVersion{

    NSString *newVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
    DebugLog(@"%@",newVersion);
    DebugLog(@"%@",[UserDataSingleton userInformation].currentVersion);

    [UserDataSingleton userInformation].xinVersion = newVersion;
}

#pragma mark - 获取当前版本号
- (void)gainCurrentVersion{

    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    [manager POST:@"http://itunes.apple.com/lookup?id=1138149514" parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {

        DebugLog(@"成功:---%@",responseObject);

        NSMutableArray *restultArray = responseObject[@"results"];
        [restultArray enumerateObjectsUsingBlock:^(NSDictionary *  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            [UserDataSingleton userInformation].currentVersion = obj[@"version"];

            [[NSNotificationCenter defaultCenter] postNotificationName:@"notificatVersion" object:nil];

//            self.block([UserDataSingleton userInformation].currentVersion);
        }];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        DebugLog(@"失败: --%@",error);
         [[NSNotificationCenter defaultCenter] postNotificationName:@"notificatVersion" object:nil];
    }];
}
- (void)jiexiaoRes{
    DebugLog(@"揭晓结果");

    [self GetLatesAnnounce];
}
- (void)kaijiangTishi{

    DebugLog(@"显示开奖提示");
    [self httpGetAwardTip];

}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

    if ([UserDataSingleton userInformation].currentVersion == nil) {
        [self gainCurrentVersion];
    }
    _LatesAnnArray=[NSMutableArray array];
    [self GetLatesAnnounce];
    if (self.num>1) {

        DebugLog(@"ferce");
    }else{
        [self refreshData];

    }
    self.tabBarController.tabBar.hidden = NO;
    self.navigationController.navigationBarHidden = NO;
    self.hidesBottomBarWhenPushed = NO;
    //    [self getTopNotice];
    //    [self startTimer];

    [self httpGetAwardTip];
}

#pragma mark - 请求新品推介

-(void)NewGoodsproduct{
    _NewGoodsArray=[NSMutableArray array];
    [MDYAFHelp AFPostHost:APPHost bindPath:NewGoods postParam:nil getParam:nil success:^(AFHTTPRequestOperation *operation, NSDictionary *responseDic) {
        DebugLog(@"~~新品推介:%@",responseDic);
        if ([responseDic[@"code"] isEqualToString:@"200"])
        {
            NSArray *array = responseDic[@"data"];

            [array enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
                NewGoodsModel *model = [[NewGoodsModel alloc]initWithDictionary:obj];
                [self.NewGoodsArray addObject:model];
            }];
        }
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {

        [SVProgressHUD showErrorWithStatus:@"网络不给力"];

    }];
}
#pragma mark - 请求最新揭晓
-(void)GetLatesAnnounce{

    [MDYAFHelp AFPostHost:APPHost bindPath:Announced postParam:nil getParam:nil success:^(AFHTTPRequestOperation *operation, NSDictionary *responseDic) {
        DebugLog(@"~~~请求最新揭晓:%@",responseDic);
        if ([responseDic[@"code"] isEqualToString:@"200"])
        {
            [_LatesAnnArray removeAllObjects];
            NSArray *array = responseDic[@"data"];

            [array enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
                LatestAnnouncedModel *model = [[LatestAnnouncedModel alloc]initWithDictionary:obj];
//                [self.LatesAnnArray addObject:model];
                if (([UserDataSingleton userInformation].currentVersion == nil)) {
                    [self.LatesAnnArray addObject:model];
                }else{
                    if (![[UserDataSingleton userInformation].currentVersion isEqualToString:[UserDataSingleton userInformation].xinVersion]) {
                        if (![model.title containsString:@"苹果"]) {
                            [self.LatesAnnArray addObject:model];
                        }
                    }else{
                        [self.LatesAnnArray addObject:model];

                    }
                }

            }];
             [self.collectionView2 reloadData];
        }
        if (_LatesAnnArray.count>0) {
            ishave=1;
        }else{

            ishave=2;
        }

        [self.collectionView2 reloadData];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {

        [SVProgressHUD showErrorWithStatus:@"网络不给力"];

    }];
}

- (void)crateView
{
    if (!self.headerView2){
        //分类按钮
        self.headerView2 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, MSW, 50 - 10)];
        self.headerView2.backgroundColor = [UIColor whiteColor];

        for (NSInteger i = 0; i < 5 ; i ++)
        { UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
            button.frame = CGRectMake(MSW/5 * i, 0,MSW/5, 50 - 10);
            button.tag = 101 + i;
            button.titleLabel.font = [UIFont systemFontOfSize:MiddleFont];
            [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
            [button setTitleColor:MainColor forState:UIControlStateSelected];
            [button addTarget:self action:@selector(sortingButton:) forControlEvents:UIControlEventTouchUpInside];
            button.titleLabel.textAlignment=UITextAlignmentCenter;
            button.backgroundColor=[UIColor clearColor];

            switch (button.tag)
            {
                case 101:
                {
                    [button setTitle:@"最热" forState:UIControlStateNormal];
                    button.titleLabel.font = [UIFont systemFontOfSize:BigFont];
                    button.selected = YES;
                    _lastSelectedBtn2 = button;
                    [self.btns addObject:button];

                }
                    break;
                case 102:
                {
                    [button setTitle:@"最快" forState:UIControlStateNormal];
                    button.titleLabel.font = [UIFont systemFontOfSize:BigFont];
                    [self.btns addObject:button];

                }
                    break;
                case 103:
                {
                    [button setTitle:@"最新" forState:UIControlStateNormal];
                    button.titleLabel.font = [UIFont systemFontOfSize:BigFont];
                    [self.btns addObject:button];

                }
                    break;
                case 104:
                {
                    [button setTitle:@"高价" forState:UIControlStateNormal];
                    button.titleLabel.font = [UIFont systemFontOfSize:BigFont];
                    [self.btns addObject:button];

                }
                    break;

                default:
                {
                    [button setTitle:@"低价" forState:UIControlStateNormal];
                    button.titleLabel.font = [UIFont systemFontOfSize:BigFont];
                    [self.btns addObject:button];

                }
                    break;
            }

            UIView *myView = [[UIView alloc]initWithFrame:CGRectMake(0, 39, MSW, 0.5)];
            myView.backgroundColor = RGBCOLOR(219, 219, 219);
            [self.headerView2 addSubview:myView];
            [self.headerView2 addSubview:button];

        }

        _redLine2 = [[UIView alloc]initWithFrame:CGRectMake(MSW/10-20, 38,40,2)];
        _redLine2.backgroundColor = MainColor;
        [self.headerView2 addSubview:_redLine2];

        self.headerView2.hidden = YES;
        [self.view addSubview:self.headerView2];
     }
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
//    [self.headerView2 removeFromSuperview];
    sellerDetail.userInteractionEnabled=YES;

}

#pragma mark - 滚动视图监听事件
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
//    DebugLog(@"==================%lf",scrollView.contentOffset.y);

    if (ishave==1) {
        if (scrollView.contentOffset.y >= MSW*0.4+MSW/3+30+10+30+10 + 10)
        {
            self.headerView2.hidden = NO;
        }
        if (scrollView.contentOffset.y <= MSW*0.4+MSW/3+30+10+30+10 +10)
        {
            self.headerView2.hidden = YES;
        }
    }else{

        if (scrollView.contentOffset.y >= MSW*0.4)
        {
            self.headerView2.hidden = NO;
        }
        if (scrollView.contentOffset.y <= MSW*0.4)
        {
            self.headerView2.hidden = YES;
        }

    }
}

#pragma mark - 导航 - 搜索
- (void)setNavBar
{
    //左导航
   sellerDetail = [UIButton buttonWithType:UIButtonTypeCustom];
    sellerDetail.frame = CGRectMake(50, 20, 29, 29);
    [sellerDetail setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [sellerDetail setImage:[UIImage imageNamed:@"shouyesearch"] forState:UIControlStateNormal];
    sellerDetail.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
    [sellerDetail addTarget:self action:@selector(search) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *leBtn = [[UIBarButtonItem alloc] initWithCustomView:sellerDetail];
    self.navigationItem.leftBarButtonItem = leBtn;
    //右导航
    UIButton *message = [UIButton buttonWithType:UIButtonTypeCustom];
    message.frame = CGRectMake(MSW-50, 20, 29, 29);
    [message setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [message setImage:[UIImage imageNamed:@"shouyetongzhi"] forState:UIControlStateNormal];
    message.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
    [message addTarget:self action:@selector(message) forControlEvents:UIControlEventTouchUpInside];

    UIBarButtonItem *rightBtn = [[UIBarButtonItem alloc] initWithCustomView:message];
    self.navigationItem.rightBarButtonItem = rightBtn;

}

#pragma mark  - 搜索
- (void)search
{
//    SearchViewController *searchVC = [[SearchViewController alloc]init];
//    [self.navigationController pushViewController:searchVC animated:YES];
    //分类
    sellerDetail.userInteractionEnabled=NO;
    ClassificationViewController *classificationVC = [[ClassificationViewController alloc]init];
    [self.navigationController pushViewController:classificationVC animated:YES];

}

#pragma mark  - 消息
-(void)message
{
    NotifyController *userData = [[NotifyController alloc]init];
    userData.hidesBottomBarWhenPushed=YES;
    [self.navigationController pushViewController:userData animated:YES];
}
#pragma mark - 创建数据
- (void)initData
{
    self.dataArray = [NSMutableArray array];
    _awardTipArray = [NSMutableArray array];
    self.btns = [NSMutableArray array];
    self.barArray = [NSMutableArray array];
    self.btnArray = [NSMutableArray array];
    self.classNum = @"10";
    self.tagd = 101;
}

#pragma mark   添加 下拉刷新 和 上拉 加载
-(void)addPullRefreshToCollectionView:(UICollectionView *)collectionView
{
    __unsafe_unretained __typeof(self) weakSelf = self;

    // 下拉刷新
    collectionView.mj_header= [MJRefreshNormalHeader headerWithRefreshingBlock:^{

        [weakSelf refreshData];
        [weakSelf GetLatesAnnounce];
    }];
    [collectionView.mj_header beginRefreshing];

    // 上拉加载
    collectionView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
        [weakSelf loadMoreData];
    }];
    // 默认先隐藏footer
    collectionView.mj_footer.hidden = YES;
}

#pragma mark 刷新数据的方法
-(void)refreshData
{
    self.num = 1;
    NSMutableDictionary *dict = [NSMutableDictionary dictionary];
    [dict setValue:self.classNum forKey:@"order"];
    DebugLog(@"--%@",self.classNum);
    [dict setValue:[NSString stringWithFormat:@"%ld",(long)self.num] forKey:@"p"];
    DebugLog(@"==========%@",dict[@"order"]);
    [MDYAFHelp AFPostHost:APPHost bindPath:Goods postParam:dict getParam:nil success:^(AFHTTPRequestOperation *operation, NSDictionary *responseDic) {

        [self requestPicture];
        [self refreshSuccessful:responseDic];

    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {

        [self refreshFailure:error];

    }];
}

- (void)refreshSuccessful:(id)data
{

    [self.nonetwork removeFromSuperview];
    [self.dataArray removeAllObjects];

    __weak HomeViewController *weakSelf = self;

    if ([data isKindOfClass:[NSDictionary class]])
    {
        if([data[@"code"] isEqualToString:@"200"])
        {
            weakSelf.collectionView.mj_footer.state = MJRefreshStateIdle;
            NSArray *array = data[@"data"];
            [array enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
                GoodsModel *model = [[GoodsModel alloc]initWithDictionary:obj];
                DebugLog(@"成功%@",model.title);

                if (([UserDataSingleton userInformation].currentVersion == nil)) {
                     [weakSelf.dataArray addObject:model];
                }else{
                    if (![[UserDataSingleton userInformation].currentVersion isEqualToString:[UserDataSingleton userInformation].xinVersion]) {
                        if (![model.title containsString:@"苹果"]) {
                            [weakSelf.dataArray addObject:model];
                        }
                    }else{
                       [weakSelf.dataArray addObject:model];
                    }

                }

            }];
        }
    }
    [self initcollectionView];

    [self.collectionView reloadData];
    // 结束刷新
    [self.collectionView.mj_header endRefreshing];
}

- (void)refreshFailure:(NSError *)error
{

    [self nonetworking];
    [SVProgressHUD showErrorWithStatus:@"网络不给力"];
    [self.collectionView.mj_header endRefreshing];

}

#pragma mark 加载数据的方法
-(void)loadMoreData
{
    self.num = self.num +1;
    NSMutableDictionary *dict = [NSMutableDictionary dictionary];
    [dict setValue:self.classNum forKey:@"order"];
    [dict setValue:[NSString stringWithFormat:@"%ld",(long)self.num] forKey:@"p"];
    [MDYAFHelp AFPostHost:APPHost bindPath:Goods postParam:dict getParam:nil success:^(AFHTTPRequestOperation *operation, NSDictionary *responseDic) {
        [self loadingSuccessful:responseDic];
        DebugLog(@"成功%@",responseDic);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {

        [self loadingFailure:error];
    }];

}

- (void)loadingSuccessful:(id)data
{
    __weak HomeViewController *weakSelf = self;
    [self.nonetwork removeFromSuperview];

    if ([data isKindOfClass:[NSDictionary class]])
    {
        if ([data[@"code"] isEqualToString:@"400"])
        {
            self.collectionView.mj_footer.state = MJRefreshStateNoMoreData;

        }
        if([data[@"code"] isEqualToString:@"200"])
        {
            NSArray *array = data[@"data"];
            [array enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
                GoodsModel *model = [[GoodsModel alloc]initWithDictionary:obj];
                DebugLog(@"成功%@",model.title);
                if ([[NSString stringWithFormat:@"%lu",self.dataArray.count] isEqualToString:data[@"count"]])
                {
                    self.collectionView.mj_footer.state = MJRefreshStateNoMoreData;
                }

                if (([UserDataSingleton userInformation].currentVersion == nil)) {
                    [weakSelf.dataArray addObject:model];
                }else{
                    if (![[UserDataSingleton userInformation].currentVersion isEqualToString:[UserDataSingleton userInformation].xinVersion]) {
                        if (![model.title containsString:@"苹果"]) {
                            [weakSelf.dataArray addObject:model];
                        }
                    }else{
                        [weakSelf.dataArray addObject:model];
                    }
                }
                [self.collectionView.mj_footer endRefreshing];

            }];
        }

    }
    [self.collectionView reloadData];
}

- (void)loadingFailure:(NSError *)error
{
    [SVProgressHUD showErrorWithStatus:@"当前网络不给力"];
    [self nonetworking];
    self.num = self.num -1;
    [self.collectionView.mj_footer endRefreshing];
}

#pragma mark - 轮播图
- (void)requestPicture
{
    self.imageArray = [NSMutableArray array];
    [MDYAFHelp AFGetHost:APPHost bindPath:ShufflingFigure param:nil success:^(AFHTTPRequestOperation *operation, NSDictionary *responseDic) {
        if ([responseDic isKindOfClass:[NSDictionary class]])
        {
            DebugLog(@"=-%@",responseDic);
            if ([responseDic[@"code"] isEqualToString:@"200"])
            {
                NSArray *array = responseDic[@"data"];
                [array enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
                    AdModel *model = [[AdModel alloc]initWithDictionary:obj];

                    DebugLog(@" 轮播图-----%@------%@",responseDic,model.img);

                    [self.imageArray addObject:model];
                }];

                if (ishave==1 ||ishave==2) {
                    [self createUI];

                }

            }
        }
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {

        [SVProgressHUD showErrorWithStatus:@"网络不给力"];
    }];
}
#pragma mark - 请求栏目
- (void)renquelanmu
{
    [MDYAFHelp AFPostHost:APPHost bindPath:Bar postParam:nil getParam:nil success:^(AFHTTPRequestOperation *operation, NSDictionary *responseDic) {
        DebugLog(@"栏目:%@",responseDic);
        if ([responseDic[@"code"] isEqualToString:@"200"])
        {
            NSArray *array = responseDic[@"data"];
            DebugLog(@"栏目数量====%ld",(unsigned long)self.barArray.count);
            [array enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
                LanMuModel *model = [[LanMuModel alloc]initWithDictionary:obj];
                [self.barArray addObject:model];

                DebugLog(@"%lu---%@",self.barArray.count,model.thumb);
            }];
        }
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {

        [SVProgressHUD showErrorWithStatus:@"网络不给力"];

    }];
}

#pragma mark - UI
- (void)createUI
{

    if (!self.scrollView)
    {
        self.scrollView = [[IanScrollView alloc] initWithFrame:CGRectMake(0, 0, MSW ,MSW*0.4)];
        NSMutableArray *array = [NSMutableArray array];
            for (NSInteger i = 0; i < self.imageArray.count; i ++) {
            [array addObject:[NSString stringWithFormat:@"%@",((AdModel *)self.imageArray[i]).img]];
        }
        self.scrollView.slideImagesArray = array;
        self.scrollView.ianEcrollViewSelectAction = ^(NSInteger i){

            AdModel *model=[self.imageArray objectAtIndex:(long)i];

            if ([model.type isEqualToString:@"1"]) {//文章
                PictureDetailController *classVC = [[PictureDetailController alloc]init];
                classVC.style=3;
                classVC.fromtitle=model.title;
                classVC.fromurl=model.val;
                [self.navigationController pushViewController:classVC animated:YES];
            }
            if ([model.type isEqualToString:@"2"]) {//专题
                PictureDetailController *classVC = [[PictureDetailController alloc]init];
                classVC.style=3;
                classVC.fromtitle=model.title;
                classVC.fromurl=model.val;
                [self.navigationController pushViewController:classVC animated:YES];
            }

            if ([model.type isEqualToString:@"3"]) {
                //  商品列表
                GoodsDetailsViewController *detailsVC = [[GoodsDetailsViewController alloc]init];
                detailsVC.tiaozhuantype = 1;
                detailsVC.idd = model.val;//
                detailsVC.hidesBottomBarWhenPushed = YES;
                [self.navigationController pushViewController:detailsVC animated:YES];
            }
            if ([model.type isEqualToString:@"4"]) {//商品详情

                ClassificationGoodsViewController *classVC = [[ClassificationGoodsViewController alloc]init];
                classVC.dataString = model.val;
                classVC.title = @"搜索结果";
                classVC.titlestr= model.val;
                classVC.nameString=model.val;
                classVC.isSarch=YES;
                classVC.isSection=NO;
                classVC.hidesBottomBarWhenPushed = YES;
                [self.navigationController pushViewController:classVC animated:YES];

}

        };
        self.scrollView.ianCurrentIndex = ^(NSInteger index){
            DebugLog(@"测试一下:%ld",(long)index);
        };
        self.scrollView.PageControlPageIndicatorTintColor = [UIColor colorWithRed:255/255.0f green:244/255.0f blue:227/255.0f alpha:1];
        self.scrollView.pageControlCurrentPageIndicatorTintColor = [UIColor colorWithRed:67/255.0f green:174/255.0f blue:168/255.0f alpha:1];
        self.scrollView.autoTime = [NSNumber numberWithFloat:4.0f];

        [self.scrollView startLoading];
        [self.collectionView addSubview:self.scrollView];

        if (ishave==1)
        {
            latesview=[[UIView alloc]initWithFrame:CGRectMake(0, MSW*0.4, MSW, MSW/3+60+10 + 20)];
            latesview.backgroundColor=[UIColor clearColor];
            [self.collectionView addSubview:latesview];

            if (!self.layOut2)
            {
                self.layOut2 = [[UICollectionViewFlowLayout alloc] init];
            }
            self.layOut2.itemSize = CGSizeMake(MSW / 3, MSW/3+70 + 19);
            self.collectionView2 = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, MSW, MSW/3+70 + 19) collectionViewLayout:self.layOut2];
            self.collectionView2.dataSource = self;
            self.collectionView2.delegate = self;
            self.collectionView2.backgroundColor = [UIColor clearColor];
            [self.collectionView2 registerClass:[LatesAnnViewCell class] forCellWithReuseIdentifier:collectionCellName2];
            self.collectionView2.tag=2;
            self.collectionView2.scrollEnabled = NO;
            [latesview addSubview:self.collectionView2];

            UILabel*lbtitle=[[UILabel alloc]initWithFrame:CGRectMake(10, 3, MSW-70, 37)];
            lbtitle.text=@"最新揭晓";
            lbtitle.backgroundColor=[UIColor whiteColor];
            lbtitle.userInteractionEnabled = YES;
            lbtitle.font=[UIFont systemFontOfSize:BigFont];
            lbtitle.textColor=[UIColor blackColor];
            [latesview addSubview:lbtitle];

            UIButton*btall=[[UIButton alloc]initWithFrame:CGRectMake(MSW-70, 3, 70, 37)];
            [btall setTitle:@"显示全部>" forState:UIControlStateNormal];
            [btall addTarget:self action:@selector(gotolatesannounce) forControlEvents:UIControlEventTouchUpInside];
            btall.backgroundColor=[UIColor whiteColor];
            btall.userInteractionEnabled = YES;
            btall.titleLabel.font=[UIFont systemFontOfSize:MiddleFont];
            [btall setTitleColor:[UIColor grayColor] forState:0];
            [latesview addSubview:btall];

            UILabel*lbline2=[[UILabel alloc]initWithFrame:CGRectMake(0, 40, MSW, 1)];
            lbline2.backgroundColor=[UIColor groupTableViewBackgroundColor];
            [latesview addSubview:lbline2];
            UILabel*lbline3=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, MSW, 2)];
            lbline3.backgroundColor=[UIColor groupTableViewBackgroundColor];
            [latesview addSubview:lbline3];
        }

        //下面间隔
        //    UIView *myView = [[UIView alloc]initWithFrame:CGRectMake(0, latesview.frame.size.height + latesview.frame.origin.y, MSW, 10)];
        //    myView.backgroundColor = RGBCOLOR(234, 235, 236);
        //    [self.collectionView addSubview:myView];
        //    self.headerView = [[UIView alloc] initWithFrame:CGRectMake(0, MSW*0.4 +MSW/3+30+10+30+10, MSW, 50)];

        self.headerView = [[UIView alloc] initWithFrame:CGRectMake(0, latesview.bottom, MSW, 50 -10)];

     if (ishave==1) {
         self.headerView .frame= CGRectMake(0, latesview.bottom, MSW, 50 -10);

    }else{

         self.headerView .frame= CGRectMake(0, MSW*0.4, MSW, 50 -10);
        }

        self.headerView.backgroundColor = [UIColor whiteColor];

        for (NSInteger i = 0; i < 5 ; i ++)
        {
            UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
            button.frame = CGRectMake(MSW/5 * i, 0, MSW/5, 50 - 10);
            button.tag = 101 + i;
            button.titleLabel.font = [UIFont systemFontOfSize:MiddleFont];
            [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
            [button setTitleColor:MainColor forState:UIControlStateSelected];
            [button addTarget:self action:@selector(sortingButton:) forControlEvents:UIControlEventTouchUpInside];
            button.titleLabel.textAlignment=UITextAlignmentCenter;
            button.backgroundColor=[UIColor clearColor];

            switch (button.tag)
            {
                case 101:
                {
                    [button setTitle:@"最热" forState:UIControlStateNormal];
                    button.titleLabel.font = [UIFont systemFontOfSize:BigFont];
                    button.selected = YES;
                    _lastSelectedBtn = button;
                    [self.btns addObject:button];

                }
                    break;
                case 102:
                {
                    [button setTitle:@"最快" forState:UIControlStateNormal];
                    button.titleLabel.font = [UIFont systemFontOfSize:BigFont];
                    [self.btns addObject:button];

                }
                    break;
                case 103:
                {
                    [button setTitle:@"最新" forState:UIControlStateNormal];
                    button.titleLabel.font = [UIFont systemFontOfSize:BigFont];
                    [self.btns addObject:button];

                }
                    break;
                case 104:
                {
                    [button setTitle:@"高价" forState:UIControlStateNormal];
                    button.titleLabel.font = [UIFont systemFontOfSize:BigFont];
                    [self.btns addObject:button];

                }
                    break;

                default:
                {
                    [button setTitle:@"低价" forState:UIControlStateNormal];
                    button.titleLabel.font = [UIFont systemFontOfSize:BigFont];
                    [self.btns addObject:button];
                }
                    break;
            }

            UIView *myView = [[UIView alloc]initWithFrame:CGRectMake(0, 39, MSW, 0.5)];
            myView.backgroundColor = RGBCOLOR(219, 219, 219);
            [self.headerView addSubview:myView];
            [self.headerView addSubview:button];

        }

        _redLine = [[UIView alloc]initWithFrame:CGRectMake(MSW/10-20, 38,40,2)];
        _redLine.backgroundColor = MainColor;
        [self.headerView addSubview:_redLine];

        [self.collectionView addSubview:self.headerView];

    }
    //    if (self.barArray.count > 0)
    //    {
    //        //按钮
    //        if (!self.buttonView)
    //        {
    //            self.buttonView = [[UIView alloc]initWithFrame:CGRectMake(0, 150, MSW, 90)];
    //            self.buttonView.backgroundColor = [UIColor whiteColor];
    //            [self.collectionView addSubview:self.buttonView];
    //
    //            for (int i = 0; i < 4; i ++)
    //            {
    //                UIView *btnView = [[UIView alloc]initWithFrame:CGRectMake(MSW / 4 * i, 0, MSW / 4, 90)];
    //                btnView.userInteractionEnabled = YES;
    //                btnView.layer.masksToBounds = YES;
    //                self.btn = [[UIImageView alloc]init];
    //                self.btn.userInteractionEnabled = YES;
    //                self.btn.frame = CGRectMake(btnView.frame.size.width / 2 - 25, 15,IPhone4_5_6_6P(50, 50, 50, 60), IPhone4_5_6_6P(50, 50, 50, 60));
    //                self.btn.tag = 101 + i;
    //
    //                //1.创建手势
    //                self.tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(buttonClick:)];
    //                //2.设置属性
    //                self.tap.numberOfTapsRequired = 1;//次数 单击
    //                self.tap.numberOfTouchesRequired = 1;//几根手指
    //                [self.btn addGestureRecognizer:self.tap];
    //
    //                // [btn addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
    //
    //                switch (self.btn.tag)
    //                {
    //                    case 101:
    //                    {
    //                        [self.btn sd_setImageWithURL:[NSURL URLWithString: ((LanMuModel *)self.barArray[i]).thumb] placeholderImage:[UIImage imageNamed:DefaultImage]];
    //                        //      [btn setBackgroundImage:imageView.image forState:UIControlStateNormal];
    //                    }
    //                        break;
    //                    case 102:
    //                    {
    //                        [self.btn sd_setImageWithURL:[NSURL URLWithString: ((LanMuModel *)self.barArray[i]).thumb] placeholderImage:[UIImage imageNamed:DefaultImage]];
    //
    //                        // [btn setBackgroundImage:[UIImage imageNamed:@"1-12"] forState:UIControlStateNormal];
    //                    }
    //                        break;
    //                    case 103:
    //                    {
    //                        [self.btn sd_setImageWithURL:[NSURL URLWithString: ((LanMuModel *)self.barArray[i]).thumb] placeholderImage:[UIImage imageNamed:DefaultImage]];
    //
    //                        //    [btn setBackgroundImage:[UIImage imageNamed:@"1-13"] forState:UIControlStateNormal];
    //                    }
    //                        break;
    //                    default:
    //                    {
    //                        //      [btn setBackgroundImage:[UIImage imageNamed:@"1-14"] forState:UIControlStateNormal];
    //                        [self.btn sd_setImageWithURL:[NSURL URLWithString: ((LanMuModel *)self.barArray[i]).thumb] placeholderImage:[UIImage imageNamed:DefaultImage]];
    //                    }
    //                        break;
    //                }
    //                UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0, self.btn.frame.size.height + self.btn.frame.origin.y + 5, btnView.frame.size.width, 10)];
    //                label.font = [UIFont systemFontOfSize:BigFont];
    //                label.textColor=RGBCOLOR(25, 25, 25);
    //                label.textAlignment = NSTextAlignmentCenter;
    //                label.tag = 101 + i;
    //                switch (label.tag)
    //                {
    //                    case 101:
    //                    {
    //                        label.text = ((LanMuModel *)self.barArray[i]).title;
    //                    }
    //                        break;
    //                    case 102:
    //                    {
    //                        label.text = ((LanMuModel *)self.barArray[i]).title;
    //
    //                    }
    //                        break;
    //                    case 103:
    //                    {
    //                        label.text = ((LanMuModel *)self.barArray[i]).title;
    //
    //                    }
    //                        break;
    //                        default:
    //                    {
    //                        label.text = ((LanMuModel *)self.barArray[i]).title;
    //
    //                    }
    //                        break;
    //                }
    //
    //                [btnView addSubview:self.btn];
    //                [self.barArray addObject:self.btn];
    //                [btnView addSubview:label];
    //                [self.buttonView addSubview:btnView];
    //
    //            }
    //
    //        }
    //    }
    //
    //    //广播滚动
    //    if (!self.radioScrollView)
    //    {
    //        self.radioScrollView = [[HeadlineScrollview alloc]initWithFrame:CGRectMake(0,150 + 90,MSW,35)];
    //        _radioScrollView.delegate = self;
    //        _radioScrollView.backgroundColor = [UIColor whiteColor];
    //        [self.collectionView addSubview:self.radioScrollView];
    //
    //        //下面间隔
    //        UIView *myView = [[UIView alloc]initWithFrame:CGRectMake(0, self.radioScrollView.frame.size.height + self.radioScrollView.frame.origin.y, MSW, 10)];
    //        myView.backgroundColor = RGBCOLOR(234, 235, 236);
    //        [self.collectionView addSubview:myView];
    //        //图标
    //        UIImageView *imageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"1-15"]];
    //        imageView.frame = CGRectMake(10, self.radioScrollView.frame.size.height / 2 - 8, 25, 17);
    //        [self.radioScrollView addSubview:imageView];
    //        //上方间隔线
    //        UIView *hengView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, MSW, 1)];
    //        hengView.backgroundColor = RGBCOLOR(234, 235, 236);
    //        [self.radioScrollView addSubview:hengView];
    //    }

    //-----------B模块------z最新揭晓------------

}

//#pragma mark 定时器
//- (void)startTimer
//{
//    _timedata = 0;
//    if (!_topImageChangeTimer || ![_topImageChangeTimer isValid])
//    {
//        self.topImageChangeTimer = [NSTimer scheduledTimerWithTimeInterval:1.0f
//                                                                    target:self selector:@selector(onTimer)
//                                                                  userInfo:nil  repeats:YES];
//    }
//}
//-(void)onTimer{
//    _timedata ++;
//    if (_timedata % 5 == 0) {
//        [_radioScrollView changeHeadlinePage];
//    }
//
//}

#pragma mark 首页公告点击
-(void)selectHeadline:(NotifyDto *)dto{

    GoodsDetailsViewController *detailsVC = [[GoodsDetailsViewController alloc]init];
    detailsVC.idd = dto.sid;
    detailsVC.username=dto.title;
    detailsVC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:detailsVC animated:YES];

}
#pragma mark - 获取首页公告
-(void)getTopNotice{

    NSMutableDictionary *dict = [NSMutableDictionary dictionary];
    [dict setValue:[UserDataSingleton userInformation].uid forKey:@"yhid"];
    [dict setValue:[UserDataSingleton userInformation].code forKey:@"code"];

    [MDYAFHelp AFPostHost:APPHost bindPath:Notice postParam:dict getParam:nil success:^(AFHTTPRequestOperation *operation, NSDictionary *responseDic) {
        DebugLog(@"===:%@",responseDic);
        if ([responseDic isKindOfClass:[NSDictionary class]])
        {
            if ([responseDic[@"code"] isEqualToString:@"200"])
            {
                NSArray *array = responseDic[@"data"];
                [array enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
                    NotifyDto *model = [[NotifyDto alloc]initWithDictionary:obj];
                    [self.headlineArray addObject:model];
                    //                    DebugLog(@"++++++%@===",self.headlineArray);
                    [_radioScrollView setHeadlineView:self.headlineArray];
                }];
            }
            else{
                [self.headlineArray removeAllObjects];
                [_radioScrollView updateError];
            }
        }

    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [SVProgressHUD showErrorWithStatus:@"网络不给力"];

    }];

}

#pragma mark - 刷新tableview按钮
- (void)sortingButton:(UIButton *)button
{
    DebugLog(@"%ld",button.tag);

    [UIView animateWithDuration:0.3 animations:^{
        _redLine.frame = CGRectMake(MSW/5 * (button.tag-101)+MSW/10-20, 38,40,2);
        _redLine2.frame = CGRectMake(MSW/5 * (button.tag-101)+MSW/10-20, 38,40,2);
    }];

    if (_lastSelectedBtn) {
        _lastSelectedBtn.selected = !_lastSelectedBtn.selected;
    }
    if (_lastSelectedBtn2) {
        _lastSelectedBtn2.selected = !_lastSelectedBtn2.selected;
    }
//    button.selected = !button.selected;
//    _lastSelectedBtn = button;

    UIButton *btn = (UIButton *)[self.headerView viewWithTag:button.tag];
    btn.selected = !btn.selected;
    _lastSelectedBtn = btn;

    UIButton *btn2 = (UIButton *)[self.headerView2 viewWithTag:button.tag];
    btn2.selected = !btn2.selected;
    _lastSelectedBtn2 = btn2;

    switch (button.tag)
    {
        case 101:
        {
            _buttonstate=1;
            self.classNum = @"10";

            [self refreshData];
        }
            break;
        case 102:
        {
            _buttonstate=2;
            self.classNum = @"30";
            [self refreshData];
        }
            break;
        case 103:
        {
            _buttonstate=3;
            self.classNum = @"20";
            [self refreshData];
        }
            break;

        case 104:
        {
            _buttonstate=4;
            self.classNum = @"40";
            [self refreshData];
        }
            break;

        default:
        {
            _buttonstate=5;
            self.classNum = @"50";
            _isSorting = !_isSorting;

//            if (_isSorting)
//            {
//                self.classNum = @"40";
//                self.xiaImageView.image = [UIImage imageNamed:@"1-17-2"];
//                self.shangImageView.image = [UIImage imageNamed:@"1-16-1"];
//            }
//            else
//            {
//                self.classNum = @"50";
//                self.shangImageView.image = [UIImage imageNamed:@"1-16-2"];
//                self.xiaImageView.image = [UIImage imageNamed:@"1-17-1"];
//            }
            [self refreshData];

        }
            break;
    }

    DebugLog(@"%@",_classNum);

//    [self.headerView2 removeFromSuperview];
    if (ishave==1)
    {
    if (self.collectionView.contentOffset.y >= MSW*0.4+MSW/3+30+10+30+10 +10)
    {
        self.collectionView.contentOffset = CGPointMake(0, MSW*0.4 +MSW/3+30+10+30+10 +10);
    }
    }else{

        if (self.collectionView.contentOffset.y >= MSW*0.4)
        {
            self.collectionView.contentOffset = CGPointMake(0, MSW*0.4 );
        }

    }
//    [self createUI];
}

#pragma mark - 4分类点击事件
- (void)buttonClick:(UITapGestureRecognizer *)button
{
    UIImageView *v = (UIImageView *)button.view;

    switch (v.tag)
    {
        case 101:
        {
            //分类
            ClassificationViewController *classificationVC = [[ClassificationViewController alloc]init];
            [self.navigationController pushViewController:classificationVC animated:YES];
            //
        }
            break;
        case 102:
        {
            //十元专区
            ClassificationGoodsViewController *classVC = [[ClassificationGoodsViewController alloc]init];
            classVC.title = @"VIP专区";
            classVC.titlestr= @"VIP专区";
            classVC.hidesBottomBarWhenPushed=YES;
            classVC.isVIP=1;
            classVC.fromcateid= ((LanMuModel *)self.barArray[1]).cateid;
            [self.navigationController pushViewController:classVC animated:YES];
        }
            break;
        case 103:
        {
            //            OrdershareController *classVC = [[OrdershareController alloc]init];
            //
            //             classVC.hidesBottomBarWhenPushed = YES;
            //
            //            [self.navigationController pushViewController:classVC animated:YES];

            if ([UserDataSingleton userInformation].isLogin == YES)
            {
                NewRedController *classificationVC = [[NewRedController alloc]init];
                classificationVC.hidesBottomBarWhenPushed = YES;
                [self.navigationController pushViewController:classificationVC animated:YES];
            }
            else
            {
                LoginViewController *loginVC = [[LoginViewController alloc]init];
                loginVC.hidesBottomBarWhenPushed=YES;
                [self.navigationController pushViewController:loginVC animated:YES];
            }
        }
            break;
        default:
        {
            //常见问题
            //            ProblemViewController *problemVC = [[ProblemViewController alloc]init];
            //            [self.navigationController pushViewController:problemVC animated:YES];
            //            [self progam];

            if ([UserDataSingleton userInformation].isLogin == YES)
            {
                MyStudentController *classVC = [[MyStudentController alloc]init];

                classVC.hidesBottomBarWhenPushed = YES;

                [self.navigationController pushViewController:classVC animated:YES];

            }
            else
            {
                LoginViewController *loginVC = [[LoginViewController alloc]init];
                loginVC.hidesBottomBarWhenPushed=YES;
                [self.navigationController pushViewController:loginVC animated:YES];
            }
        }
            break;
    }
}

#pragma mark  常见问题请求
-(void)progam
{
    NSMutableDictionary *dict = [NSMutableDictionary dictionary];

    [dict setValue:[UserDataSingleton userInformation].uid forKey:@"yhid"];
    [dict setValue:[UserDataSingleton userInformation].code forKey:@"code"];

    // DebugLog(@"==========%@",dict[@"code"]);
    [MDYAFHelp AFPostHost:APPHost bindPath:changjian postParam:dict getParam:nil success:^(AFHTTPRequestOperation *operation, NSDictionary *responseDic) {

        DebugLog(@"===================%@",responseDic);
        if([responseDic[@"code"] isEqualToString:@"200"])
        {
            PWWebViewController *web = [[PWWebViewController alloc] initWithRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:responseDic[@"data"]]]];
            web.showToolBar = NO;
            web.hidesBottomBarWhenPushed = YES;
            //  常见问题
            web.navtitle = @"常见问题";
            [self.navigationController pushViewController:web animated:YES];
        }

    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [SVProgressHUD showErrorWithStatus:@"网络不给力"];

    }];

}

#pragma mark -collectionView
- (void)initcollectionView
{
    UICollectionViewFlowLayout *layOut = [[UICollectionViewFlowLayout alloc] init];
    layOut.itemSize = CGSizeMake(MSW / 2, 70+MSW/2);
    layOut.minimumLineSpacing = 0.5;
    layOut.minimumInteritemSpacing = 0.5;
    if (!self.collectionView)
    {
        self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, MSW, MSH - 64 - 44) collectionViewLayout:layOut];
        self.collectionView.dataSource = self;
        self.collectionView.delegate = self;
        self.collectionView.backgroundColor = [UIColor whiteColor];
        [self.collectionView registerClass:[GoodsCollectionViewCell class] forCellWithReuseIdentifier:collectionCellName];
//        [self.collectionView registerNib:[UINib nibWithNibName:@"HomeCollectionCell" bundle:nil] forCellWithReuseIdentifier:@"HomeCollectionCell"];
        self.collectionView.scrollEnabled = YES;
        self.collectionView.tag = 1;
        [self.view addSubview:self.collectionView];
        [self addPullRefreshToCollectionView:self.collectionView];
//        [self requestPicture];
    }

    [self crateView];
}

-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    //有多少个Cell
    // self.collectionView.frame = CGRectMake(0, 0, MSW, self.dataArray.count / 2 * 180);
    if (collectionView.tag==2) {
        if (_LatesAnnArray.count>2) {
            return 3;
        }else{
            if (_LatesAnnArray.count>0) {
                return _LatesAnnArray.count;
            }else{
                return 0;
            }
        }
    }else{
    return self.dataArray.count;
    }
}

-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    if (collectionView.tag == 2) {
        LatesAnnViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:collectionCellName forIndexPath:indexPath];

        cell.lbtime.text = @"";

        if (_LatesAnnArray.count>0) {

            cell.latestModel = self.LatesAnnArray[indexPath.item];

        }

        return cell;
    }else{
         GoodsCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:collectionCellName forIndexPath:indexPath];
        cell.backgroundColor = [UIColor whiteColor];

        cell.delegate = self;
        cell.goodsModel = self.dataArray[indexPath.item];

        return cell;
    }

}
#pragma mark <HomeCellDelegate>
- (void)homeCollectionCell:(HomeCollectionCell *)homeCollectionCell button:(UIButton *)button{

}

-(UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section
{

    if (collectionView.tag==2) {
        return UIEdgeInsetsMake(0, 0, 0, 0);

    }

    if (ishave==1) {
       return UIEdgeInsetsMake(MSW*0.4 +50+MSW/3+30+10+30+10, 0, 0, 0);
    }else{
    return UIEdgeInsetsMake(MSW*0.4 +40, 0, 0, 0);
    }

}

- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section;
{
    return 0;

}

- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section
{
    return 0;
}

//修改的---主页网格cell
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{

    if (collectionView.tag==2) {
        if (_LatesAnnArray.count>0)
        {
            GoodsModel *model =[_LatesAnnArray objectAtIndex:indexPath.row];

            GoodsDetailsViewController *detailsVC = [[GoodsDetailsViewController alloc]init];
            detailsVC.tiaozhuantype=2;
            detailsVC.idd=model.idd;

            detailsVC.hidesBottomBarWhenPushed = YES;
            [self.navigationController pushViewController:detailsVC animated:YES];
        }
    }else{

        GoodsDetailsViewController *detailsVC = [[GoodsDetailsViewController alloc]init];
        detailsVC.tiaozhuantype = 1;

        detailsVC.idd = ((GoodsModel *)self.dataArray[indexPath.row]).idd;
        detailsVC.hidesBottomBarWhenPushed = YES;
        [self.navigationController pushViewController:detailsVC animated:YES];
    }
}

#pragma mark 购物车动画
- (void)clickCell:(GoodsCollectionViewCell *)cell model:(GoodsModel *)model
{
//    //用坐标转化就将传出来的按钮左边转换为相对self.view的坐标
//    CGRect rect = [cell.goodsImageView convertRect:cell.goodsImageView.bounds toView:self.view];
//    //创建一个视图,模拟购物图片
//    UIImageView *someThing = [[UIImageView alloc]initWithFrame:CGRectMake(rect.origin.x, rect.origin.y+64, MSW/2-20, MSW/2-20)];
//    someThing.layer.cornerRadius = 10;
//
//    someThing.image  = cell.goodsImageView.image;
//    someThing.backgroundColor=[UIColor clearColor];
//    //加入到父视图
//    //[self.view addSubview:someThing];
//    [[UIApplication sharedApplication].keyWindow addSubview:someThing];
//
//    UITabBar *tabBar = self.tabBarController.tabBar;
//
//    //动画改变坐标
//    [UIView animateWithDuration:1 animations:^{
//        someThing.frame = CGRectMake(tabBar.frame.origin.x + IPhone4_5_6_6P(215, 215, 250, 280),tabBar.frame.origin.y ,20,20);
//
//    } completion:^(BOOL finished) {
//        [someThing removeFromSuperview];
//    }];

    GoodsDetailsViewController *detailsVC = [[GoodsDetailsViewController alloc]init];
    detailsVC.tiaozhuantype = 1;

    detailsVC.idd = model.idd;
    detailsVC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:detailsVC animated:YES];

}
-(void)gotolatesannounce{
    self.tabBarController.selectedIndex = 1;
    [self.navigationController popToRootViewControllerAnimated:YES];
}
-(void)allnewgoods{
    ClassificationViewController *classificationVC = [[ClassificationViewController alloc]init];
    [self.navigationController pushViewController:classificationVC animated:YES];
}

//最新揭晓-----模块点击事件
-(void)Lasetesannaction:(UIButton *)sender{

    DebugLog(@"-----点击了第%li个",sender.tag);

    GoodsModel *model =[_LatesAnnArray objectAtIndex:sender.tag];

    DebugLog(@"-------%@",model.idd);

    GoodsDetailsViewController *detailsVC = [[GoodsDetailsViewController alloc]init];
    detailsVC.tiaozhuantype=2;
    detailsVC.idd=model.idd;
    DebugLog(@"!!!!!!!!!!%@",((LatestAnnouncedModel *)self.dataArray[sender.tag]).idd);
    detailsVC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:detailsVC animated:YES];

}
//新品推介 -----模块点击事件
-(void)newgddsaction:(UIButton *)sender{
    DebugLog(@"-----点击了第%li个",sender.tag);
    GoodsDetailsViewController *detailsVC = [[GoodsDetailsViewController alloc]init];
    detailsVC.tiaozhuantype = 1;
    DebugLog(@"---%@",((NewGoodsModel *)self.NewGoodsArray[sender.tag]).idd);
    detailsVC.idd = ((NewGoodsModel *)self.NewGoodsArray[sender.tag]).idd;
    detailsVC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:detailsVC animated:YES];

}

#pragma mark - 消息推送
-(void)getAPNS:(NSDictionary *)userInfo{
}

- (void)nonetworking
{
    if (!self.nonetwork)
    {
        self.nonetwork = [[NoNetwork alloc]init];

        [self.nonetwork.btrefresh addTarget:self action:@selector(refreshData) forControlEvents:UIControlEventTouchUpInside];
    }
    [self.view addSubview:self.nonetwork];
}

#pragma mark - 中奖提示(Added by liwenzhi)
- (void)httpGetAwardTip
{
    self.index = 0;
    NSMutableDictionary *dict = [NSMutableDictionary dictionary];
    [dict setValue:[UserDataSingleton userInformation].uid forKey:@"yhid"];
    [dict setValue:[UserDataSingleton userInformation].code forKey:@"code"];
    NSLog(@"yhid=%@, code=%@",[UserDataSingleton userInformation].uid, [UserDataSingleton userInformation].code);
    [MDYAFHelp AFPostHost:APPHost bindPath:AwardTip postParam:dict getParam:nil
                  success:^(AFHTTPRequestOperation *operation, NSDictionary *responseDic) {

                      DebugLog(@"中奖提示 = %@",responseDic);
                      if ([EncodeFormDic(responseDic, @"code") isEqualToString:@"200"]) {
                          NSMutableArray *awardArray = [NSMutableArray array];
                          NSArray *array = responseDic[@"data"];

                          for (NSDictionary *item in array) {
                              GoodsModel *model =[[GoodsModel alloc]initWithDictionary:item];
                              [awardArray addObject:model];
                          }
                          _awardTipArray = awardArray;

                          [self showTipView];
                      }
                      else{
                          //                          [SVProgressHUD showErrorWithStatus:responseDic[@"msg"]];
                          [_awardTipArray removeAllObjects];
                      }

                  } failure:^(AFHTTPRequestOperation *operation, NSError *error) {

                  }];
}
- (void)showTipView
{
    if (self.index < _awardTipArray.count) {

        GoodsModel *model = _awardTipArray[_index];
        _awardTipView = [[AwardTipView alloc]init];
        _awardTipView.periodLbl.text = [NSString stringWithFormat:@"第%@期",model.qishu];
        _awardTipView.awardLbl.text = model.title;
        _awardTipView.delegate = self;
        _awardTipView.lookBtn.tag = 100 + _index;
        _awardTipView.shareBtn.tag = 200 + _index;
        [_awardTipView.lookBtn addTarget:self action:@selector(lookBtnTouched:) forControlEvents:UIControlEventTouchUpInside];
        [_awardTipView.shareBtn addTarget:self action:@selector(shareBtnTouched:) forControlEvents:UIControlEventTouchUpInside];
        //控制中奖提示是否显示
        [_awardTipView show];
        self.index ++;
    }else{
        self.index = 0;
    }
}
- (void)lookBtnTouched:(UIButton *)button
{
    [_awardTipView hidden];

    WinningRecordViewController *vc = [[WinningRecordViewController alloc]init];
    vc.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:vc animated:YES];
}
- (void)shareBtnTouched:(UIButton *)button
{
    NSMutableDictionary *dict = [NSMutableDictionary dictionary];
    [dict setValue:[UserDataSingleton userInformation].uid forKey:@"yhid"];
    //    [dict setValue:[UserDataSingleton userInformation].code forKey:@"code"];

    [MDYAFHelp AFPostHost:APPHost bindPath:Share postParam:dict getParam:nil success:^(AFHTTPRequestOperation *operation, NSDictionary *responseDic) {

        if ([responseDic[@"code"] isEqualToString:@"200"])
        {
            [_awardTipView hidden];

            NSDictionary*data = responseDic[@"data"];
            _url              = data[@"url"];
            _title            = data[@"title"];
            _content          = data[@"content"];
            _imgurl           = data[@"imgurl"];

            [self shareAction];
        }

    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {

        [SVProgressHUD showErrorWithStatus:@"网络不给力"];
    }];
}

- (void)shareAction
{
    UIImage *image = [[EGOImageLoader sharedImageLoader] imageForURL:[NSURL URLWithString:_imgurl] shouldLoadWithObserver:nil];

    //构造分享内容
    id<ISSContent> publishContent = [ShareSDK content:[NSString stringWithFormat:@"%@",_content]
                                       defaultContent:@""
                                                image:[ShareSDK pngImageWithImage:image]
                                                title:_title
                                                  url:_url
                                          description:_content
                                            mediaType:SSPublishContentMediaTypeNews];

    //创建弹出菜单容器
    id<ISSContainer> container = [ShareSDK container];
    [container setIPadContainerWithView:self.view arrowDirect:UIPopoverArrowDirectionUp];

    id<ISSAuthOptions> authOptions = [ShareSDK authOptionsWithAutoAuth:YES
                                                         allowCallback:YES
                                                         authViewStyle:SSAuthViewStyleFullScreenPopup
                                                          viewDelegate:nil
                                               authManagerViewDelegate:nil];
    //
    //    //在授权页面中添加关注官方微博
    //    [authOptions setFollowAccounts:[NSDictionary dictionaryWithObjectsAndKeys:
    //                                    [ShareSDK userFieldWithType:SSUserFieldTypeName value:@"ShareSDK"],
    //                                    SHARE_TYPE_NUMBER(ShareTypeSinaWeibo),
    //                                    [ShareSDK userFieldWithType:SSUserFieldTypeName value:@"ShareSDK"],
    //                                    SHARE_TYPE_NUMBER(ShareTypeTencentWeibo),
    //                                    nil]];

    //创建自定义分享列表
    NSArray *shareList = [ShareSDK customShareListWithType:
                          //                          SHARE_TYPE_NUMBER(ShareTypeSinaWeibo),
                          SHARE_TYPE_NUMBER(ShareTypeWeixiTimeline),
                          SHARE_TYPE_NUMBER(ShareTypeWeixiSession),
                          //                          SHARE_TYPE_NUMBER(ShareTypeQQ),
                          SHARE_TYPE_NUMBER(ShareTypeQQSpace),
                          nil];
    //显示分享菜单
    [ShareSDK showShareActionSheet:container
                         shareList:shareList
                           content:publishContent
                     statusBarTips:YES
                       authOptions:authOptions
                      shareOptions:[ShareSDK defaultShareOptionsWithTitle:nil
                                                          oneKeyShareList:[NSArray defaultOneKeyShareList]
                                                           qqButtonHidden:NO
                                                    wxSessionButtonHidden:NO
                                                   wxTimelineButtonHidden:NO
                                                     showKeyboardOnAppear:NO
                                                        shareViewDelegate:nil
                                                      friendsViewDelegate:nil
                                                    picViewerViewDelegate:nil]
                            result:^(ShareType type, SSResponseState state, id<ISSPlatformShareInfo> statusInfo, id<ICMErrorInfo> error, BOOL end) {
                                if (state == SSPublishContentStateSuccess)
                                {
                                    [self.view showHUDTextAtCenter:@"分享成功"];
                                }
                                else if (state == SSPublishContentStateFail)
                                {
                                    NSLog(NSLocalizedString(@"TEXT_SHARE_FAI", @"发布失败!error code == %d, error code == %@"), [error errorCode], [error errorDescription]);
                                    if (type == ShareTypeWeixiSession || type == ShareTypeWeixiTimeline) {
                                        [self.view showHUDTextAtCenter:@"您未安装微信客户端,分享失败"];
                                    }else{
                                        [self.view showHUDTextAtCenter:@"分享失败"];
                                    }
                                }
                            }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#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.
}
*/

@end

redpajama_set_name: RedPajamaGithub


Can I enter students for Cecchetti Medals?
Yes, as long as you are a financial Cecchetti Member with a minimum qualification of Associate and/or a financial Life Member and your students meet the medal criteria and you have supplied the National Office with current copies of your First Aid and Working With Children certificates and attended a minimum of 3 PD sessions in the previous year.
Do I need to attend Professional Development sessions (PD's)?
Yes, all active Cecchetti Teachers are expected to attend a minimum of 3 PD's per year.
Do I need to maintain my First Aid & Working With Children Check (WWC)?
Yes, this is a pre requisite for active Cecchetti teachers, examination entries will be refused if you do not!
Can I enter students for Cecchetti examinations?
Yes, as long as you are a financial Cecchetti Associate or above, Pre Registered Member or a financial Life Member, have supplied the National Office with current copies of your First Aid and Working With Children certificates and attended a minimum of 3 PD sessions in the previous year.
What level students can I enter into examinations?
Pre Registered & Associate Members – up to and including Intermediate.
Associate Diploma Members – up to and including Advanced 1 & Associate.
Licentiate Members – up to and including Advanced 1 and Associate Diploma.
Licentiate Diploma Members – up to and including Advanced 1 and Licentiate.
Fellow Members – all levels including the Enrico Cecchetti Diploma.
Do I need to be a financial student member to be listed as a 'coach' on examination entries?
What is the minimum examination level to qualify for student membership?
What is the pre requisite for Associate examinations?
What is the Pre requisite for the Associate Diploma/Certificate IV in teaching Cecchetti classical ballet?
March 1st to secure the early bird fee.
Why haven't I received my school's examination certificates?
- Are you financial? Does the National Office have a copy of your current First Aid and Working With Children certificates?
- They may have been lost in the post, check with your State Examination Organiser.
At all times, please remember that your State Examination Organiser is a volunteer and as such deserves your respect, cooperation and gratitude at all times.
Will I receive notification my purchase has been successful?
Once the purchase through PayPal is complete, an automated email from Cecchetti Ballet will be sent to you with instructions. PayPal payment notification is sent from PayPal separately.
Can I download to a mobile device such as my smart phone or tablet device?
That depends upon your purchase and your device. Technical notes are in pdf format and can be downloaded directly to any device. However, Digital Music downloads are mp3 files in a zipped file so it depends upon your device. I suggest you research your device and the manufacturers instruction on how it deals with zipped files.
Our service is not like iTune Music, the downloads are packaged in a zip compressed file and may need to be downloaded to a Desktop or Laptop/Notebook Computer. Mobile devices such as iPhones and iPad may not be currently supported without specific applications installed. You can, however, transfer your files to your iPhone or iPad once you have downloaded them to a desktop or laptop computer. If unsure if your device supports download of zip files refer to the manufacturer's instructions.
What format is the music in?
The download format is MP3. These files play back beautifully in iTunes, Windows Media Player, your iPhone/Android phone, etc. and include metadata such as the artist and track names. Our MP3s use variable bit-rate encoding (VBR) to shrink the size of the files while maintaining the highest quality. This means you get faster downloads and with smaller file sizes you can fit more on your device. If you have an older MP3 player that doesn't like VBR files, sorry but it may be time to upgrade your current device.
When you download a music CD from Cecchetti Ballet it arrives on your computer in a compressed format called zip. Before you can add the music to your library and listen to it, you'll need to decompress, or "unzip" it. Doing this is an easy process. If you're on a Mac, double-click the file. You're done. If you're on a PC, right-click the file and choose Extract All. You're also done.
Need more instructions on how to unzip files, go here.
I downloaded music from Cecchetti Ballet, now how do I get it into iTunes or Windows Media Player?
Please do a Google search.
How do you create a playlist in Windows Media Player?
For Windows Media Player support Click here.
My download says Link is expired or you do not have access.
Send an email to the Cecchetti Ballet National Office for assistance. Please include the email address used for your Cecchetti account, the items purchased and the date of purchase.
These error messages indicate the same thing: that the downloaded file is incomplete, probably due to a glitch in your internet connection. The solution is to try downloading the file again (click the link in your receipt from Cecchetti). The music downloads are quite large, so if you're on a wireless connection you might try a direct connection instead if this is possible. You can verify that your download is complete by right-clicking it and selecting Properties (or if you're on a Mac, by clicking it and choosing File>Get Info). The size of your download should match the file size indicated on the track listing for each music level. This can be found on the 'Shop' page.
I can't find my download on my computer. I need help!
If you're using Windows, start by looking in your My Downloads and My Music folders. If your download isn't there, please try your download again. Download links are available by either logging into your account and going to the Ordered Files tab or you can use the links in the receipt Cecchetti Ballet Australia has emailed you. Always click Save (not Open) in the dialog that appears, and in the subsequent dialog, choose a location for the file, but remember to note which folder you're saving to.
My download didn't get to 100% and then it stopped. What should I do? or, My download is taking forever. Suggestions?
Go ahead and stop the download, sign into your Cecchetti Ballet Account and try again. Also, if you're on wireless try plugging directly in).
I've placed an order for E-Goods but I can't download my purchase.
There are two options of accessing your download links.
As a Registered User you can log into the Shop account and download by Sign In into My Account then the Purchased Orders tab.
Click on the link/s within the Cecchetti emailed Invoice.
Make sure it is the same email and password you registered the account with. If you really can't get access into the account contact secretary@cecchettiballet.org directly. Provide details such as email address used, products purchased and date of purchase.
I 've placed an order for E-Goods but I haven't received any email notifications for the created order or order has been processed.
If you haven't received emails within 2 hours and it's not in your spam folder, we suggest as a Registered User, Sign In to My Account on the Cecchetti Shop and check your order history. (In fact, you can do this process immediately after the purchase is complete if you choose.) If your most recent order is not listed, there is an issue. Contact secretary@cecchettiballet.org directly.
We have an automated system but unfortunately, technical glitches occur and things can happen once emails leave our servers.
If you entered your email address incorrectly into PayPal it is going to be sent to an invalid account and we'll receive an email stating it is undeliverable. Contact the National Office and an alternate means of delivery will be organised. It must be noted the onus is on the buyer to make sure the email associated with the PayPal account is valid and you have access to it.
I didn't or couldn't download my purchased files within the stipulated 3 days and now the link has expired.
Contact enrico@cecchettiballet.org or secretary@cecchettiballet.org and make sure to include information about the products you purchased, the email used to log into the Cecchetti Ballet account and date of purchase. We will renew the link/s for another 2 days.


The Adidas Ultra Boost 4.0 is the fourth version of the popular Ultra Boost line. The new model will be introduced in December 2017 and it will feature an updated Primeknit Upper.
Basically, as for other features, it will be similar to the Ultra Boost 3.0. So, let's see what the shoe offers and which colors are going to pop in this winter.
All white shoe looks dope as it resembles one-piece construction. Padding in the collar and the tongue together with the heel counter and the plastic cage contribute to support and comfort. The Primeknit upper features a different design. However, it doesn't look offbeat in the white color.
Searching for the brand new model with the modern touch? The Adidas Ultra Boost 4.0 will meet your needs! Featuring the boost midsole with a black outsole, the shoe offers appealing contrast. But it doesn't sacrifice comfort as the padded insole, a secure lacing system, a stretchy upper make the shoe comfortable.
The Ultra Boost 4.0 took comfort to the next level. The shoe features a plain combination of the black Primeknit upper with tonal cage and heel overlays and the white boost midsole. If you need the shoe, which may be both athletic and casual, and has a long lifespan, this model will give you it and even more.
A brand new model of the Ultra Boost in the burgundy color gives a polished silhouette. The Pimeknit upper is thicker and more durable compared to the previous versions. The full-length boost unit, the TPU cage, and the heel counter make the shoe comfortable, supportive, and secure.
A new color of the revolutionary Ultra Boost 4.0 is for people, who like a modern touch in footwear. The Boost midsole and the Continental outsole are of the same color so that they look like one unit. The Primeknit upper features a new pattern and a translucent midfoot cage so that the sneakers look different than the Ultra Boost 3.0.
Good stability, comfort, safety, flexibility, durability, and a bold design – this is about the new Ultra Boost 4.0. Thanks to the durable Primeknit upper, the grippy Continental outsole, the cushy insole, a secure lacing for a snug fit, the shoe is a perfect choice for training and casual life. Besides, the design is also appealing as the shoe features the black rubber outsole to contrast the pure white upper.
Adidas is known for creating the shoes with superior comfort and the Ultra Boost 4.0 is one of them. It has the same technologies, which the Ultra Boost 3.0 has, the new model features a more rigid upper and the TPU overlays, which create a snug fit. Indeed, there is a rainbow effect on the upper. It has a navy blue base with a variety of hues sprinkled throughout the Primeknit upper.
Are you the fan of the Adidas Ultra Boost? Do you like perfect cushioning and support the Ultra Boost provides? If yes, then the brand new model Adidas Ultra Boost 4.0 is what you need. Along with a modern appeal due to the plastic midfoot cage and the Primeknit upper, the shoe offers perfect shock absorption, responsiveness, and support thanks to the Boost technology.
Many owners of the Ultra Boost found the plastic midfoot cage unnecessary, so Adidas decided to create an uncaged model and later, the uncaged laceless model has been released. It features a futuristic design, the Primeknit upper has replaced the cage. The shoe also has a full-length boost midsole for cushioning and a heel counter for stability.
Up-to-date technologies, combined with a classic design, is what the Ultra Boost 4.0 Black White represents. But there's something more. The shoe is extremely stable and comfortable due to the elastic ad thick Primeknit upper, a grippy rubber outsole, the Torsion system and the Boost Technology.
The Boost technology has been introduced in 2013 and since then, Adidas sneakers with this technology are the ultimate choice for people all over the world. Adidas has started the Ultra Boost line with the Ultra Boost 1.0, which is still number one for many people. Later, the brand has introduced the Ultra Boost 2.0 and 3.0 and the Ultra Boost 4.0 will pop in this December. Actually, it features almost the same design like the Ultra Boost 3.0 has with slight changes. Here is the Adidas Ultra Boost 4.0 review.
The whole shoe is made of the Primeknit, which has a different pattern (compared to the previous versions). The Primeknit technology has been updated and the upper became stretchier and more rigid. The Ultra Boost's signature heel counter and the cage also adorn the new runner shoe. The tongue and the collar are padded and a new BOOST logo has appeared on the insole, which is as comfortable as in the previous versions. The upper, the forefoot, midfoot and the heel area are as foot-hugging and supportive as always. The boost midsole is full-length. But that's not all. The changes have touched upon the outsole.
The outsole is made of the updated Continental rubber, which is highly durable and grippy. In fact, it enhances performance and safety as provides up to 15% better traction on various surfaces than other models. The outsole features the traditional for the Ultra Boost stretchweb pattern and a Torsion system for stability.
On top of that, the model comes in new and bold colors.
Overall, the design looks pretty much the same with the Ultra Boost 3.0 except for the Primeknit pattern and the TPU cage.
The Primeknit upper is lightweight and in the Ultra Boost 4.0, it has been improved. Besides, the midsole with the Boost technology is also lightweight. Therefore, the weight is optimal for training or casual wear.
Thanks to the Boost technology, the shoe is exceptionally cushy and responsive as it provides perfect shock absorption. Besides, padding in the tongue, collar and in the insole adds to overall cushioning.
The Primeknit upper is very breathable, so there is good air ventilation in the shoe.
The Continental rubber, used in the outsole, is durable, yet it is not stiff. The midsole is bouncy. So, the shoe bends well. Besides, the Primeknit upper is elastic and flexible.
The heel counter offers the natural fit, the Primeknit upper is foot-hugging and supportive, so you have a lockdown fit. The TPU cage also holds the foot in its place. Besides, the Torsion system ensures the midfoot integrity and the Continental outsole gives good traction on various terrain.
The insole is padded and has the Ultra Boost logo.
The Primeknit means that the entire upper is knitted in one piece. Knitting fused yarn gives the necessary amount of flexibility and support. The material is lightweight and it hugs the foot for perfect comfort.
The Ultra Boost 4.0 features the semi-transparent TPU midfoot cage for support and stability. TPU is any of a class of polyurethane plastics with many properties, including elasticity.
The heel counter ensures good stability.
Adidas Torsion System helps the shoe to adapt to various surfaces. It limits the rotation of the front part, protecting the foot from damage.
Boost Technology is used in the midsole. It means that TPU was blown up and reshaped into miniature energy capsules (about 3000), which give the highest energy return as they compress and come in the original shape quickly.
Primeknit Technology means that the upper of the shoe was made from digital knitting technology. The upper is a one-piece construction without seams. The material is elastic so the Primeknit fits the contours of the foot for a precision fit.
The Continental rubber outsole is more durable than other outsoles. Besides, it's been proven that it gives up to 30% more grip than other outsoles. Eventually, stability, safety, and traction are increased.
Adidas Ultra Boost 4.0 is the latest version of the Boost line. Basically, it is the improved version of the Adidas Ultra Boost 3.0. It features a neater "ribbed" texture and contrasting Primeknit patterns on the toe, tongue, and the heel. Additionally, it has an improved three stripes cage around the midfoot. The plastic is more rigid and it is semi-transparent. The Boost midsole, the heel counter and the Continental rubber on the outsole remained unchanged.
So, go for the Adidas Ultra Boost 4.0 if you want to have improved comfort, flexibility, and support.


text:
Home / Martin: Die Weise von Liebe und Tod des Cornets Christoph Rilke
Martin: Die Weise von Liebe und Tod des Cornets Christoph Rilke
Variant CD
"It seems as if this text became a part of my life", wrote Swiss composer Frank Martin about Rainer Maria Rilke's famous prose poem "The Lay of the Love and Death of Cornet Christoph Rilke", on which he based his composition for alto singer and orchestra. Rilke's short text describes the fate of a young soldier in a powerful way, who pointlessly rode o into his death during the Ottoman wars in the 17th century. Frank Martin devoted himself to this poem during Second World War and created a highly expressive and thrilling setting. Philharmonia Records releases a live recording of Frank Martin's Cornet at the Zurich Opera House with the Philharmonia Zurich under the direction of Fabio Luisi. The solo part is sung by German alto singer Okka von der Damerau, who is particularly known for her interpretations of major Wagner and Verdi roles as well as her vast concert repertoire.
What was it like listening to 23 songs in 60 minutes without a word of text? For me it was pure heaven. Martin links them together so well, both tonally and often without breaks, that I felt them as a whole, not as 23 songs (but there are 23 tracks on the album). Okka von der Damerau is a true contralto with a deep lower timbre. Her voice is a dead ringer for the great Janet Baker: rich with nuance and expression and so natural that I was unconscious of her vibrato except as a point of emphasis.
The Zurich Philharmonia is the orchestra of the Zurich Opera, of which Fabio Luisi has been music director since 2012, and it sounds as richly nuanced and expressive as Damerau, from whisper soft to battle- and ecstasy-driven powerful. In fact, I've never heard Luisi sound as all-consumed in any of his broadcasts from the Met as he is here. Soloist and conductor are hand-in-glove.
The engineering couldn't be better. Yes, the sound, recorded in concert, is opera-house dry but still fully present whether quiet or loud; and the balances are superb, both in the orchestra and between soloist and orchestra. But then I'm a sucker for Frank Martin's music, which edges toward Alban Berg's moodiness but is tonally based and here at its most spiritual and atmospheric, with his special gift for propelling the music forward often with a waltzing grace as the substratum.
– American Record Guide
Catalog Number: PHR 0108
Label: Accentus
Composer: Frank Martin
Conductor: Fabio Luisi
Orchestra/Ensemble: Philharmonia Zurich
Performer: Okka von der Damerau

redpajama_set_name: RedPajamaCommonCrawl


With only four weeks until the Australian Bus + Coach Show at Rosehill Gardens in Sydney, there is a positive vibe about all industry players coming together for the free two day exhibition.
Following a tradition started many years ago at the Warwick Farm Bus Show, culminating in 2009 show at Rosehill Gardens, there is a lot of history behind this 'feel good event' for the industry, according to BusNSW Executive Director Darryl Mellish.
"There has been a long tradition of bus and coach operators, old and new, coming to the Sydney Show to enjoy friendships and the passion that has made the industry a great success," he says.
"Whilst the industry continues to evolve and adapt to change, the camaraderie between operators, suppliers and other stakeholders will always be present."
This year's show will feature a number of free technology workshops that are open to all attendees.
There will be a choice of two workshops every thirty minutes between 2pm and 4pm on both Wednesday October 5 and Thursday October 6.
Mellish says the technology workshops will give attendees an opportunity to get 'up close and personal' with leading suppliers to learn about using new technology to improve performance and efficiency.
"Participants can get involved with practical demonstrations and will have a chance to question the expert presenters," he says.
For technology workshop times and locations, attendees should refer to the official show program.
Bus and Coach operators are encouraged to bring their families, as the show will include a jumping castle for children, and vintage double decker rides provided by the Sydney Bus Museum.
"With exhibition booths, vehicle displays, and food options spread across a number of areas, there will be a real village atmosphere to be enjoyed by all," Mellish says.
All important visitor, exhibitor and conference information is available on the official Australian Bus and Coach Show 2011 website www.busshow.com.au.
"The show website provides up to date exhibitor lists, maps, parking, travel and accommodation information for attendees," says Mellish.


Renting an apartment may prove to be quite costly. Landlords appear to be more likely to increase rentals almost on a monthly basis. Almost all tenants across the globe are complaining about the rentals, which have continued to skyrocket on a daily basis. For this reason, a good number of tenants are resorting to the purchase of their own houses in a bid to cut on the cost of rentals. But the idea of buying a new apartment may not be a good one for people who lack the financial muscle and the much needed experience to single out an apartment that is worth buying. Consider the following tips if you want to buy one of the big charlotte apartments.
To start with, take your time to explore the location of the apartment that you want to buy. This step is very important because it will reveal the pros and cons of living in the area. In other words, this step mainly acts as an eye opener that helps you to reinforce or reverse your initial decision. However, it is always advisable to take into account all the important factors. For example, you may consider the proximity of the apartment to your place of work. If you intend to be living in the apartment, this is one of the most important factors that you have to take into account. You can also take into account the proximity of the apartment to nearby shopping facilities. It is very important to live in a house that is as close as possible to nearby shopping facilities. It makes life much easier and more convenient.
If you or one of your family members needs sufficient medical care, you should not live in an apartment which is located far from medical centers. This may put the lives of you or your family members at risk. For example, expecting couples and families with members who have chronic illnesses should live nearby a reliable medical facility. This ensures the safety of family members and everyone living in the area. It also makes it easy for you and your close family members to easily seek medical attention when emergency situations arise. There are many health related emergencies that may arise including heart attacks and seizure.
Buying an apartment that is as free as possible from boundary disputes is always advisable. The last thing that any tenant would love to experience is to be involved in a serious boundary dispute. It makes life quite inconvenient and even disturbing. Imagine living in a house whose boundaries are not properly defined, you may find yourself throwing rubbish in an area belonging to your neighbor. You may be sued for doing so or you may incur extra costs for taking such a wrong action. In order to avoid any of the above from happening, simply buy an apartment that is free from disputes.


Required fields for constituent do not apply to relationship (non-constituent) records, this includes the act of promoting them to Constituent.
Users are prompted for the required attributes if the above is performed without an initial save to the relationship record. For instance, a new relationship is created and added as a constituent before the relationship record is saved, a prompt that attributes are missing will appear. However, this does not apply if working with old/existing relationship records.


text:
Transit Services
About The Transit Services Division
The Transit Services Division (Gold Country Stage)
Gold Country Stage provides local and regional fixed route bus service to the Cities, towns and unincorporated areas of Western Nevada County, including Nevada City, Grass Valley, Penn Valley, Rough and Ready, Lake Wildwood, Alta Sierra, Lake of the Pines and the regional hub at the Auburn Amtrak station.
Gold Country Stage was started in 1975 by the County of Nevada and a Joint Powers Agreement (JPA) between the cities of Grass Valley and Nevada City. The system began with only two routes serving Grass Valley and Nevada City. The system has subsequently grown over the years and now operates six routes throughout Western Nevada County.
Contact Us - We Moved!
Gold Country Stage welcomes your questions and comments. Please feel free to contact us by mail, email or phone.
Gold Country Stage
12350 La Barr Meadows Rd., Ste 3
Phone: 530-477-0103 or toll free at 888-660-RIDE (7433)
Email: Gold Country Stage
Robin Van Valkenburgh
Transit Services Manager
Email Robin Van Valkenburgh
12350 La Barr Meadows Rd.
950 Maidu Ave
Phone: 530-477-0103, ext. 1003
Sightseeing With Gold Country Stage
Procurement / RFP's


Sherrilene Classen, Charles Levy, Dennis McCarthy, William C. Mann, Desiree Lanford, J. Kay Waid-Ebbs; Traumatic Brain Injury and Driving Assessment: An Evidence-Based Literature Review. Am J Occup Ther 2009;63(5):580-591. doi: 10.5014/ajot.63.5.580.
OBJECTIVE. We conducted a literature review of assessment tools predicting driving performance for people with traumatic brain injury (TBI).
METHOD. Data sources were Web of Science, EBSCOhost, PubMed, and recently published literature from experts and team members not yet catalogued in the databases. We used the American Academy of Neurology's classification criteria to extract data from 13 studies, and we assigned a class (I–IV, with I being the highest level of evidence) to each study. We grouped primary studies into categories of driving assessment (neuropsychological; simulator; off-road; self-report, other report, and postinjury disability status; and comprehensive driving evaluation) and synthesized the predictability of these tools as it relates to driving performance for people with TBI.
CONCLUSIONS. To assist clinicians and researchers in making decisions regarding testing the driving performance of people with TBI, we provide recommendations for neuropsychological tests; off-road tests; self-report, other report, and postinjury disability status; and comprehensive driving evaluation.


Some rivalries are born out of entertainment some are born because wrestlers are the best at that they do. This week we will discuss one of the best rivalries ever in Kurt Angle vs Chris Benoit, where these two legends gave it all they head over a three year period. Two of the best wrestlers to ever lace up boots, you knew Kurt Angle and Benoit wasn't going to disappoint from an in ring standpoint, but with the element of entertainment Kurt Angle brought it made for an even more entertaining rivalry. Whether it was about tapping out to a submission or their reluctant tag team, they would entertain the audience through the duration of their epic feud.
It was tough to pinpoint a single match that was their best encounter, because there are so many, but this is the one we selected and I think most would agree that it's hard to argue against it.
-Hands down their best encounter. This wasn't about entertainment. This wasn't about fun. This was about Angle being back on the mountaintop and Benoit wanting to win the title. These two went out and put on an absolute clinic. When you think of a wrestling clinic this is the match you show people, for a few reasons. For one, Angle showcased why he was one of the best. Two, Benoit had what would likely be considered his breakthrough performance, as the standing ovation he got after the match was huge, and set the tone for him to win the Rumble the very next season. There are so many matches we could reference as their best, as they have some classics on Smackdown, at Unforgiven 2002, Backlash 2001, and many others. This feud would spawn so many great matches that it would take up the entire article. There isn't a bad match in their feud at all.
There are so many great matches that we figured we should list a couple of those, since there are no bad matches to speak of, only matches that were too short and mostly don't even count. Let's take a look at the underrated matches.
-We were tempted to put their Unforgiven 2002 clash here in the first spot but this match was too good to ignore. You have to love every second of this. These two went out there and arguably had the best match of the night. It was simply fantastic. They never had a bad match as the two had excellent chemistry that can never be ignored, so with that being said, let's take a look at two more underrated matches in their feud.
-Another match between these two technicians that showcased exactly what you expected. Angle and Benoit went at each other with everything they had and this match tends to get slept on just because it's a part of one of the greatest events in WWE history, and in my opinion, the greatest Wrestlemania ever.
-The master of the Ankle Lock. The master of the Crossface. These two went at it in an often forgotten match that showed that both men were able to compete at the highest level for over 30 minutes. This match was fun, and even went to sudden death, where Benoit pulled out the win continuing his face turn and push. I honestly think that 2001 feud between Angle and Benoit is one of the best feuds in ring wise of the last 20 years. It was consistent top tier performances over and over again, and this match was another on the list.
I would say Angle won barely, as the high profile matches saw him get the win, including Wrestlemania 17 and Judgment Day 2001, along with their best match, Royal Rumble 2003. Benoit got the victory at Unforgiven 2002 and Backlash 2001, but it seemed that Angle had his number. This feud would end up catapulting Benoit to the next level, pushing him to become a main event level star by the time it was finished, so in reality, no one really lost this feud. It's a classic feud that needs to be remembered and appreciated for years to come.