LiveRoomDetailViewController.swift
2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// 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()
}
}