//
//  AboutUsViewController.m
//  Macalline
//
//  Created by JianjiYuan on 14-12-11.
//  Copyright (c) 2014年 JianjiYuan. All rights reserved.
//

#import "AboutUsViewController.h"

@interface AboutUsViewController ()
{
    UIImageView *imageVBg;
    UIImageView *imageVLogo;
    UILabel *lblVersion;
    UILabel *lblIntroduce;
    
}

@end

@implementation AboutUsViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        
        self.title = @"关于我们";
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    imageVBg = [UIImageView newAutoLayoutView];
   // imageVBg.image = [UIImage imageNamed:@"Login/mainbg_login.png"];
    [self.view addSubview:imageVBg];
    
    imageVLogo = [UIImageView newAutoLayoutView];
    imageVLogo.image = [UIImage imageNamed:@"Login/logo_login.png"];
//    imageVLogo.image = [UIImage imageNamed:@"aboutUs@2x.png"];
    imageVLogo.autoresizingMask = UIViewAutoresizingNone;
    [self.view addSubview:imageVLogo];
    
    NSString *curVersion = [[NSBundle mainBundle] infoDictionary][@"CFBundleVersion"];
    lblVersion = [UILabel newAutoLayoutView];
    //lblVersion.textColor = [UIColor whiteColor];
    lblVersion.textColor=[UIColor darkGrayColor];
    lblVersion.text = [NSString stringWithFormat:@"终端巡检在线  V %@", curVersion];

   [lblVersion setFont:[UIFont fontWithName:@"Helvetica-Bold" size:19]];
  
    lblVersion.backgroundColor = [UIColor clearColor];
    lblVersion.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:lblVersion];
    
    lblIntroduce = [UILabel newAutoLayoutView];
    //lblIntroduce.textColor = RGBColor(54, 182, 242, 1);
    lblIntroduce.textColor = [UIColor darkGrayColor];
    
    lblIntroduce.text = [NSString stringWithFormat:@"       全球家居 百MALL时代 这是一个中国家居行业新模式发展的时代——大家居消费时代 这是一个厂商品牌聚集的时代——家居品牌化时代 这是一个消费者能有更多选择并获取更多个性化消费体验时代——新体验消费时代 这是红星美凯龙以规模化效应，为消费者提供更多的优惠、更多的产品选择以及更优质的服务的时代——品牌信赖时代 这是以Mall的形态促进中国现代商业文明崛起的时代——中国商业新高度的时代。"];
    lblIntroduce.font = [UIFont systemFontOfSize:14];
    lblIntroduce.backgroundColor = [UIColor clearColor];
    lblIntroduce.numberOfLines = 0;
    [lblIntroduce sizeToFit];
    [self.view addSubview:lblIntroduce];
    
    UIImageView* bgImage = [[UIImageView alloc] init];
    bgImage.image = [UIImage imageNamed:@"Settings/own_bag.png"];
    [self.view addSubview:bgImage];
    [bgImage autoPinEdgesToSuperviewEdgesWithInsets:UIEdgeInsetsMake(0, 0, 0, 0) excludingEdge:ALEdgeTop];
    [bgImage autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:lblIntroduce];
    
    [self setViewLayoutConstraint];
    
}

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

- (void)setViewLayoutConstraint
{
    [imageVBg autoPinEdgesToSuperviewEdgesWithInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
    
    [imageVLogo autoPinToTopLayoutGuideOfViewController:self withInset:25];
    [imageVLogo autoSetDimensionsToSize:CGSizeMake(180, 51)];
    [imageVLogo autoAlignAxisToSuperviewAxis:ALAxisVertical];
    
    
  
    
    //[lblVersion autoPinEdgesToSuperviewEdgesWithInsets:UIEdgeInsetsMake(0, 0, 20, 0) excludingEdge:ALEdgeTop];
    [lblVersion autoSetDimensionsToSize:CGSizeMake(200, 64.5)];
    [lblVersion autoPinEdge:ALEdgeTop  toEdge:ALEdgeBottom ofView:imageVLogo withOffset:8];
    [lblVersion autoAlignAxisToSuperviewAxis:ALAxisVertical];
    [lblIntroduce autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:lblVersion withOffset:15];
    [lblIntroduce autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:20];
    [lblIntroduce autoPinEdgeToSuperviewEdge:ALEdgeRight withInset:20];
}

@end
