//
//  MassageViewController.m
//  ALand
//
//  Created by Z on 16/3/18.
//  Copyright © 2016年 Z. All rights reserved.
//

#import "MassageViewController.h"
#import "MessageTableViewCell.h"
#import "UITableView+Category.h"
#import <SobotKit/SobotKit.h>
#import "NavigationbarView.h"
#import "JavenCustomerService.h"
#define kCellID @"cellId"
@interface MassageViewController ()<UITableViewDelegate, UITableViewDataSource>

@property (nonatomic, strong) UITableView *tableView;
@end

@implementation MassageViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.isShowNavigationBar = YES;
    self.title = @"消息";
    self.navigationItem.leftBarButtonItem = nil;
    
    NavigationbarView *navigationBarView = [NavigationbarView viewWithNibName:@"NavigationbarView"];
    navigationBarView.frame = CGRectMake(0, 0, kWidth, 65);
    [self.view addSubview:navigationBarView];
    [self setUpTableView];
    // Do any additional setup after loading the view.
}

- (UIStatusBarStyle)preferredStatusBarStyle {
    return UIStatusBarStyleDefault;
}


- (void)setUpTableView {
    self.tableView = [UITableView plainTableViewWithTarget:self cellNibName:@"MessageTableViewCell" cellId:kCellID];
    self.tableView.frame = CGRectMake(0, 65, kWidth, kHeight);
    [self.view addSubview:self.tableView];
}


- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 95;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 1;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [self startCustomerServices];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    MessageTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellID forIndexPath:indexPath];
    return cell;
}

- (void)startCustomerServices {
    [JavenCustomerService startCustomerServices:self];
    
}


- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}
- (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
