LiveRoomDetailViewController.swift 2.51 KB
//
//  LiveRoomDetailViewController.swift
//  YouerLiveVideo
//
//  Created by 葛建军 on 16/11/11.
//  Copyright © 2016年 左丞. All rights reserved.
//

import UIKit

class LiveRoomDetailViewController: UIViewController {
    @IBOutlet var personIcon: UIImageView!
    @IBOutlet var personNameLabel: UILabel!
    @IBOutlet var startTimeLabel: UILabel!
    @IBOutlet var coverImage: UIImageView!
    @IBOutlet var imageH: NSLayoutConstraint!
    @IBOutlet var announcementLabel: UILabel!
    @IBOutlet var startDetailTimeLabel: UILabel!
    @IBOutlet var endDetailTimeLabel: UILabel!
    @IBOutlet var isPublic: UILabel!
    @IBOutlet var isInteractive: UILabel!
    @IBOutlet var isExamineLabel: UILabel!
    @IBOutlet var scrollContentViewH: NSLayoutConstraint!
    @IBOutlet var attachViewH: NSLayoutConstraint!//附件所在View的高度
    var item:LiveDetail!//直播间详情
    let formatte=DateFormatter()
    override func viewDidLoad() {
        super.viewDidLoad()
        attachViewH.constant=0
        formatte.dateFormat="yyyy-MM-dd HH:mm:ss"
        personNameLabel.text=AppDelegate.instance().accountManager.name()
        startTimeLabel.text=formatte.string(from: Date(timeIntervalSince1970: JSON.fromString(jsonString: item.f_Description)!["starttime"].doubleValue/1000 as TimeInterval))
        coverImage.sd_setImage(with: URL(string:item.f_LiveImg), placeholderImage: UIImage(named:"icon"))
        announcementLabel.text=JSON.fromString(jsonString: item.f_Description)!["announcement"].stringValue
        startDetailTimeLabel.text=formatte.string(from: Date(timeIntervalSince1970: JSON.fromString(jsonString: item.f_Description)!["starttime"].doubleValue/1000 as TimeInterval))
        endDetailTimeLabel.text=formatte.string(from: Date(timeIntervalSince1970: JSON.fromString(jsonString: item.f_Description)!["endtime"].doubleValue/1000 as TimeInterval))
        isPublic.text = JSON.fromString(jsonString: item.f_Description)!["Public"].boolValue ? "是" : "否"
        isInteractive.text = JSON.fromString(jsonString: item.f_Description)!["interactive"].boolValue ? "是" : "否"
        isExamineLabel.text = item.f_IsExamine==0 ? "待审核" : "审核未通过"
        imageH.constant=getScreenWidth()
        scrollContentViewH.constant=50+imageH.constant+250
    }
    @IBAction func backAction(_ sender: UIBarButtonItem) {
        self.navigationController!.popViewController(animated: true)
    }

    
    
    
    
    
    
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }
}